Python statements and comments
Python Statements:
"Any code(instructions) interpreted by a python interpreter is known as python statements."
For Example:
1-Assignment Statement
a=45
2-Loop Statement
for and while loop
list=[1,2,3,4]
new_list=[]
for item in list:
if i%2==0:
new_list.append(item)
print(new_list)
3-Conditional Statement:
if,elif and else
Python Comments:
"Comments are the statement which is ignored by the python interpreter. There are two ways to define comments in the python programming language. The first way of making comments in python is to put '#' symbol before instruction or statement(Single line comments)
Python doesn't support multi-line comments instead use enclosed statements with triple quotes (docstring).
Example :
#Single line comments example
# if a>5:
# print(a)
print('=========================')
def sum(a,b):
"""
Multiline comments example
This function performs addition of two numbers
"""
return a+b
print(sum(3,4))
help(sum)