Basics · Lesson 21 of 76

Variables

A variable is a name you attach to a value so you can use it again later. You create one with =:

Python

A variable can change what it holds at any time — Python doesn't lock it:

Python

Your turn: make a variable city with your town's name, then print "I'm learning Python in <city>".

Check your understanding

You’re reading for free. Sign in to keep your progress and earn a certificate when you finish.Sign in to keep my progress →

Lesson 21 of 76