Comments in Python
Comments in python are not executed by the python interpreter. Comments help to understand the code in an easy way. There are two types of comments in python
- Single line comments
- Multiline comments
Single line comments
Single line comments are indicated using the the symbol Hash(#) . The single line comments last till the end of the line.
#sinle line comments #Organization org='tutorialtpoint' owner='Dodda Venkat Reddy' print('The organization is',org,'and the owner is',owner,'.')
Output
The organization is tutorialtpoint and the owner is Dodda Venkat Reddy .
Multiline comments
Python does not support multiline comments but by using the Hash symbol in every line we achieve it.
#Multi-line comment #comments can be written in more than one lines a=input('Enter a string:') print(a)
Output
Enter a string:Hello world Hello world
0 comments :
Post a Comment
Note: only a member of this blog may post a comment.