Lesson 4 of 34
input(): Asking the User
8 min 20 XP
input() reads what the user types. Here, before you press Run, type the values in the Input box, one per line.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.input() always gives you a string. To use it as a number, write int(input()).
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.Each input() reads the next line of the Input box.