Python Variables
Store and reuse values with clear names.
Python
name = "Ada"
score = 91
print(name, score)Output
Ada 91
Explanation
A variable gives a value a name. Python creates it when you assign with =. Names are case sensitive, and a later assignment can replace the value.
Explore the dry run
Guided walkthroughReady
1
name = "Ada"2
score = 913
print(name, score)Follow the example
Start to inspect the source, values, and output. These prepared steps explain the published sample; grouped loop steps describe multiple iterations.
View the complete dry-run table
| Step / line | What happens | State after step | Output so far |
|---|---|---|---|
| Assign the string Ada to name. | name = "Ada" | — | |
| Assign the integer 91 to score. | name = "Ada", score = 91 | — | |
| Read both variables and send them to print. | name = "Ada", score = 91 | Ada 91 |