Downloaded 11 times





A variable is a value in a program that can be changed while the program is running. Variables are given names like "name", "age", and "gender" and are written in code using the assignment operator like "age = 14". To change a variable's value while a program runs, the variable is assigned a new value using input, such as "age = input("How old are you?")". The document then provides an example program that prompts the user for their name with input, assigns the response to the name variable, and prints a greeting using that variable.