Skip to main content
Practice

Integer Division Operator //

Unlike the / operator, which returns a floating-point result (a decimal), the integer division operator // discards the decimal part and returns only the integer portion of the division.


For example, dividing 10 by 3 using the / operator yields a result of 3.3333333333333335.

/ Operator Example
result_float = 10 / 3

print(result_float) # 3.3333333333333335

In contrast, using the // operator with 10 divided by 3 returns 3, dropping everything after the decimal point

// Operator Example
result_int = 10 // 3

print(result_int) # 3

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.