Table of Contents
show
Input
- Input is data entered by user in the program
- input( ) function is available for input
Syntax
variable = input(“data”)
Example
>>> x=input("Enter your name")
Enter your name Raji
>>> y = int(input("Enter any number"))
Enter any number4
>>> type(y)
<class 'int'>
>>> type(x)
<class 'str'>
Output
Output can be displayed to the user using print statement
Syntax
print(expression / constant / variable)
Example
>>> print("Hello")
Hello
>>> print(5)
5
>>> print(5+2)
7
>>> x = 3
>>> print(x)
3
Views: 3