Practice · Python

Practice Numbers & Data Types

Distinguish int, float, str, and bool, and use type() to inspect a value's type.

Numbers & Data Typeswarming python…

Identify basic data types in space mission data (variant 2)

Write a function space_numbers() that creates four literals:

  • the integer 5
  • the float 5.0
  • the string '5'
  • the boolean True Return a tuple containing the result of type() applied to each literal in that order.

Example

>>> space_numbers()
(int, float, str, bool)
Press Run to see output, or Check to grade against the tests.

Want a whole course built around numbers & data types?

Start my path — free

Adaptive practice, streaks, projects with real code review. Free tier gates AI help, never content.

Practice Python: Numbers & Data Types — CodeArcade