Lesson 3 of 12

Variables & Data Types

🎯 Grades 6–8 ⏱ ~25 minutes 💚 Intermediate

What You'll Learn

  • Create variables and assign values to them
  • Understand the four basic data types: int, float, str, bool
  • Use type() to check what type a variable holds
Quick Check

1. Which data type is the value 3.14?

Aint
Bfloat
Cstr

2. After x = 10 then x = "ten", what type is x?

Aint
BBoth int and str
Cstr

3. Which variable name is valid in Python?

A2score
Bplayer_score
Cplayer-score

4. What does type(True) return?

A<class 'str'>
B<class 'int'>
C<class 'bool'>