How to write multi line comments and Multiple Statements on a Single Line
python path:- https://www.youtube.com/watch?v=MGX0W...
Python Comments
Comments can be used to explain Python code.
Comments starts with a #, and Python will ignore them:
# python comments
Multi Line Comments
Python will ignore string literals that are not assigned to a variable
triple-quoted string is also ignored by Python interpreter and can be used as a multiline comments:
“ “ “
This is a multiline
comment.
“ “ “
Multiple Statements on a Single Line
The semicolon ( ; ) allows multiple statements on the single line given that neither statement starts a new code block
import sys; x = 'foo'; sys.stdout.write(x + '\n')
python path:- https://www.youtube.com/watch?v=MGX0W...
Python Comments
Comments can be used to explain Python code.
Comments starts with a #, and Python will ignore them:
# python comments
Multi Line Comments
Python will ignore string literals that are not assigned to a variable
triple-quoted string is also ignored by Python interpreter and can be used as a multiline comments:
“ “ “
This is a multiline
comment.
“ “ “
Multiple Statements on a Single Line
The semicolon ( ; ) allows multiple statements on the single line given that neither statement starts a new code block
import sys; x = 'foo'; sys.stdout.write(x + '\n')
Category
📚
Learning