lecture 5
lecture 5
INPUT
Input is data entered by user (end user) in
the program.
In python, input () function is available for
input.
Syntax for input() is: variable = input
(“data”)
Example
# This is a comment.
# This is a comment,
too.
# I said that already.
DOCSTRING
def double(num):
"""Function to double the value"""
return 2*num
>>> print(double.__doc__)
Function to double the value
LINES AND INDENTATION
a=3
b=1
if a>b:
print("a is greater")
else:
print("b is greater")