1.6 Input
Rules for good variable names
- can use letters and numbers, but no spaces - must start with a letter usually lowercase - variable should describe what it holds
name = input("Who are you?") print("Hello there " + name + " nice to meet you!")
If you type your name on the output it Will come out as: Hello there Taylor nice to meet you!
Input
Pulling information into the computer For this to work, you need to have a spot in memory to hold this value.
Variable
a name for a spot in the computer's memory This value can change while the program runs
Another example of two variables
name = input("Name?") adjective = input("How are you feeling?") print("Hello there, " + name + " nice to meet you. You seem very " + adjective + "today.")