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 (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.
# 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.
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…
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!.