Basic Data Types, online

Six activities your students do on their own devices. See who's finished, and their scores.

Basic Data Types in one minute

What students need to know

Numbers with a decimal point are floats in Python. Text wrapped in quotes is a string (str) in Python.

A whole number without quotes is an integer. 42 has no decimal point — it's an integer.

Mistakes students make

  • Line 2 has a stray quote. Should be: age = 15.
  • Line 2 is missing quotes. Should be: city = "Melbourne".
  • Line 3 uses a comma not a decimal point. Should be: height = 5.8.
  • Line 3 tries to add an int and a string. score is an integer, name is a string -- they can't be added.
PREVIOUS · MODULE 4Variables
YOU ARE HERE · MODULE 5Basic Data Types
NEXT · MODULE 6Basic Arithmetic

Discover other journeys with this module

What students will learn in this module

Every question in Module 5

Quick questions

  1. What type is "Alice"?AStringBInteger
  2. What type is 15?AStringBInteger
  3. What type is 5.5?AFloatBInteger
  4. Which is a string?A"100"B100
  5. What type is 42?AFloatBInteger

Key terms

Students type the meaning of:

  • name = "Alice"
  • age = 15
  • height = 5.5

Match the pairs

'25' + 1Match it to what it does
year_born = 1989.0Match it to what it does
score = 4.5Match it to what it does
name = 'Alice'Match it to what it does
print(int('25'))Match it to what it does
print(float('3.14'))Match it to what it does

Fill in the blanks

  1. name = _______
  2. age = __
  3. height = ___
  4. score = ___("100")
  5. city = ___________

Spot the error

Question 1

Aname = "Alice"Bage = 15"Cprint(age)

Question 2

Ascore = 100Bcity = MelbourneCprint(city)

Question 3

Aname = 'Bob'Bage = 12Cheight = 5,8

Question 4

Aname = 'Alice'Bscore = 85Ctotal = score + nameDprint(total)

Question 5

Aname = 'Charlie'Bage = 15Cheight = 5.8Dcity = 'MelbourneEprint(name)