Image of Hokie Bird holding 148th birthday sign.

anniversary = 147
print(anniversary)
print("A year has passed!")
anniversary = 148
print(anniversary)

What is printed when this program runs?
Choose an answer above!
  • Variables can be assigned different values throughout a program.
  • When a variable that already has a value is assigned a new value, the old value is lost.
  • Think of your age as a variable. If you are 8 years old now, on your birthday your old age will be lost and your new age will be 9!
  • Try out the examples and exercises.