Digit Check in Python

Level 124 keystrokes

This checks if all characters are digits. The isdigit() method returns True if all characters are numeric.

Python code

# isdigit() returns True if the string is not empty and every character is a digit
# "12345" contains only digits, so True is printed
1print("12345".isdigit())

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.

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

More Python examples at level 1

← Python typing practice