← Practice
πŸ“– Variables and typesvariables-intro
LessonΒ·difficulty 1/5Β·~8 min

Variables: storing values

Variables

A variable is a name that points at a value. You make one with =:

python
age = 30
name = "Ada"
is_admin = False

Python figures out the type (integer, string, boolean, …) from the value on the right.

Your task

Create three variables:

  • name β€” your display name as a string
  • age β€” an integer
  • is_student β€” a boolean (True or False)

Then build a single string called summary that says:

"<name> is <age> years old (student: <is_student>)"

Example output for name="Ada", age=27, is_student=False:

"Ada is 27 years old (student: False)"

You don't need to print anything β€” the test runner inspects summary directly.

Tests

  • summary is a string
  • summary mentions the name
  • summary mentions the age as a string
  • summary mentions the is_student value (hidden)

✦ Stuck? Ask for a spark

warming up
Loading editor…

$ Console output will appear here.

>_AI tutor
Sign in to chat with the tutor.