Text Input

Want to get keyboard input?

To get keyboard input, use the input function.

The input function has a return variable. In this case the keyboard input. If we do not store the return variable into a programs variable, we lose it. That’s why we write a variable to store the result in.

Related Courses:
Complete Python Bootcamp: Go from zero to hero in Python

User Input

To get a text value:

This will show you:

Enter a name:

You can now give keyboard input, it will be stored in the variable name.

Note: don’t forget to store the return variable. variable = input(“..”)

Numeric input

To get a whole number:

To get a decimal number:

Previous Post
Next Post

Leave a Reply