ReePrime
How to write multi line comments and Multiple Statements on a Single Line

Hosted by Dailymotion. For legal issues report at the Copyright Center, report us on DMC, or use the Instant Removal tool.

How to write multi line comments and Multiple Statements on a Single Line

F
fun Zone

7 Views • Apr 09, 2020

Description

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')