Raw_Input and Input
There are two functions in Python that you can use to read data from the user: raw_input and input. You can store the results from them into a variable.
raw_input is used to read text (strings) from the user:
name = raw_input("What is your name? ") type(name) >>output What is your name? spilcm type 'str'>
input is used to read integers
age = input("What is your age? ") print "Your age is: ", age type(age) >>output What is your age? 100 Your age is: 100 type 'int'>
Recommended Python Training
For Python training, our top recommendation is DataCamp.