Input Data

If our Python programme needs to take any input from user then we can input() function.

Example of Python input:

In the above example, we are asking user to provide us their name using input function. The user input name is then saved into the name variable. Finally the name is then displayed using print function

Example of input with concatenation:

In the above example, we have used input function for accepting user’s name and age values. Both values are saved into variables name and age. Using the + sign we have concatenated the text (string) message (like “your name is” and “your age is”) with the variable values of name and age. Concatenation is explained in another lesson.