It’s all well and good printing outputs for users to read, but if you want your program be interactive, you need to be able to get input from users. Python does this with the built-in input() function. Try this:

Note that you need to assign user input to a variable in order to use it in your program.

Python assumes all input is in the form of a string. In order to do math with input, you would need to convert it to an integer:

favorite = int(input("What's your favorite number?"))
squared = favorite * favorite
print("The square of your number is:", str(squared))

The int() function tries to take the input (a string of letters and/or numbers) and makes it into an integer. Try entering a letter; you’ll get an error message.

On the other hand, the str() function converts things to strings. When it is a string, you can do string things that you can’t do with numbers. For instance, try:

name = input("What's your name?")
print(name.upper())

The + is another special string operator that concatenates (combines) two strings. If you try 14 + 14, Python will return 28. But if you do str(14) + str(14), you’ll get back 1414.

An important point about the input() function: it waits for the user to hit Enter, then takes whatever they typed before that as the input. But you can also use an empty input() function as a sort of “pause” in your program—the program won’t move on until the user hits Enter. This is something we’ll make use of!