Integer Conversion in Python

Level 116 keystrokes

This converts the string '42' to an integer. The int() function parses a string and returns an integer.

Python code

# "42" is a string (text), not a number
# int() converts it to the integer 42, which is printed
1print(int("42"))

Output

42
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

More Python examples at level 1

← Python typing practice