Type Check in Python

Level 117 keystrokes

This prints the type of 3.14, which is <class 'float'>. The type() function shows the data type of a value.

Python code

# type() returns the type (class) of a value
# 3.14 has a decimal point, so it is a float and <class 'float'> is printed
1print(type(3.14))

Output

<class 'float'>
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Python code and how often they appear.

  • (× 2
  • )× 2
  • .× 1

More Python examples at level 1

← Python typing practice