Learn how to request and store information from users in your programs
Inputs let us type something into the computer so it can use our answers in the program.
name = input("What is your name? ")
This code asks a user to enter their name. The
user's input will be stored in the variable: name
name = input("What is your name? ").lower()
The addition of .lower() means that the user's
input will be converted to lower case, this is
beneficial for comparing values.
name = str(input("What is your name? "))
The addition of str() means that users can only
enter a string value. Other data types will not be
accepted.
Inputs can be set to exclusive for other data types by using either: int, float, or bool in the same way.