Python print statement | Python multiline comment in Python 3

Python print statement | Python multiline comment: Python is a simple language with respects to any other programing language. Even, youโ€™re a beginner and you donโ€™t understand any programing language. Youโ€™ll be able to conjointly are aware of it terribly clearly as a result of its syntax is far easier than the other programing language. Now we are going to learn how to use the Python print statement and Python multiline comment in Python 3.

Python Print Statement
Python Print Statement

Python print statement (Hello World Program)

Python print statement is used to print the statements or values of variables on the screen. Suppose we want to print statements โ€œHello worldโ€ย. we are able to write straightforward as

print ("Hello world!")

The Python print statement will also be used to print multiple lines whether in an exceedingly single perform or single Program.

name1 = "Computer"
print ( name1 )
name2 = "Physics"
print ( name2 )
name3 = "Math"
print ( name3 )

We donโ€™t use any other statements or syntax (Donโ€™t use the semi-colon at the end of every statement like other programming languages) to print Hello world!. Thatโ€™s why Python is an easy language.

Python multiline commentย 

How to use a Python comment?

Comments are used as a hint of line or program to make it easier to know. They donโ€™t effect other code of the program. we tend to use hash (#) to write down any comment line in Python Programming. Everything that you simply will write after the hash(#) symbol will be neglected by the compiler.
Like

# How to use Comments?
name = " Python may be a straightforward language "
print ( name ) #print statement is used to print the value of name variable.
#In Python, the comment is formed by inserting an octothorpe ( otherwise identified hash symbol: # )

Python does not have multiline comments that are used in several alternative languages like C and C++ etc.

Python multiline comment in Python 3
Python multiline comment in Python 3

How to useร‚ย Python multiline comment?

In Python multiline comment, we can use a method to use multiline comments in Python which is the Docstring method. Are you interested to learn about Docstring? Yeah, thatโ€™s not a problem. Letโ€™s startโ€ฆ

Python Docstring

In Python, Docstring stands for documents string that is served as for Python multiline comment. Let we take an example to use a Docstring. See the following below example.

name="my name is ABDUL JABBAR"
""" let we take an example of Docstring
that is used for multiline comments."""
print(name)
OutPut: my name is ABDUL JABBAR


In which you learned a way to use Python print statement | Python multiline comment. I hope youโ€™ll be able to are aware of it. Are you a new visitor on my website? then you can also read my previous lecture รขโ‚ฌล“ Download python for windows and How to install python on Windows 7 โ€œ. In the upcoming lecture, we going to discuss variable and uses of it. Application of Computer Graphics and many other Programming languages. If you have any queries please discuss them within the comments section. conjointly provide your feedback. Thank you!.

Some Useful Links

Python vs PHP performance | Which language is better for web development?

Django vs Flask | which framework is best in Python Web Development?

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top