Boolean Value in Python

Level 113 keystrokes

This compares 10 and 5, printing True because 10 is greater than 5. Comparisons return boolean values.

Python code

# > is the "greater than" operator; a comparison returns True or False
# 10 is greater than 5, so the comparison is True and True is printed
1print(10 > 5)

Output

True
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.

  • (× 1
  • )× 1
  • >× 1

More Python examples at level 1

← Python typing practice