python
Variables
A variable is a name that points to a value. You create one with =:
city = "Montreal"
year = 2026
print(city)
print(year)
"Montreal"is a string (text), so it has quotes.2026is an integer (a whole number), so no quotes.
You can mix variables into a sentence with an f-string: put an f before the quotes and the variable names in {curly braces}:
print(f"In {year} I live in {city}.")
Your mission
- Create a variable
namewith your name (a string). - Create a variable
agewith your age (a number, no quotes!). - Print the sentence:
My name is ... and I am ... years old.using an f-string.