Integer Division in Python

Level 114 keystrokes

This prints 17 // 5, which is 3. The // operator divides and rounds down to the nearest integer.

Python code

# // is floor division: it divides and rounds the result down to an integer
# 17 / 5 would be 3.4; // rounds it down to 3
1print(17 // 5)

Output

3
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
  • (× 1
  • )× 1

More Python examples at level 1

← Python typing practice