Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Programming using Python

prutor.ai Amey Karkare


Dept. of CSE
IIT Kanpur

For any queries reach out to rahulgr@iitk.ac.in or rahulgarg@robustresults.com


or whatsapp 9910043510

1
Welcome Python Programming E&ICT IIT Kanpur
Interacting with Python Programs
• Python program communicates its results
to user using print

prutor.ai
• Most useful programs require information
from users
– Name and age for a travel reservation system
• Python 3 uses input to read user input as a
string (str)

2
Oct-16 Programming E&ICT IIT Kanpur
input
• Take as argument a string to print as a
prompt
• Returns the user typed value as a string

IN[1]:
prutor.ai
– details of how to process user string later

IN[2]: ( )

IN[3]:

Oct-16 Programming E&ICT IIT Kanpur


3
input
• Take as argument a string to print as a
prompt
• Returns the user typed value as a string

IN[1]:
prutor.ai
– details of how to process user string later

IN[2]: ( )

IN[3]:

Oct-16 Programming E&ICT IIT Kanpur


4

You might also like