To avoid a float result, use integer division: //
instead of /
.
More Related Contents:
- How do I parse a string to a float or int?
- How can I force division to be floating point? Division keeps rounding down to 0?
- How do you round UP a number?
- How do you check whether a number is divisible by another number?
- Convert floats to ints in Pandas?
- How to manage division of huge numbers in Python?
- Round a floating-point number down to the nearest integer?
- How do I check if a string is a number (float)?
- Maximum and Minimum values for ints
- Python strings and integer concatenation [duplicate]
- The `is` operator behaves unexpectedly with non-cached integers
- How to round a floating point number up to a certain decimal place?
- Format floats with standard json module
- How does Python manage int and long?
- Range values to pseudocolor
- Convert integer to string in Python
- Convert hex to float
- Safest way to convert float to integer in python?
- What is the range of values a float can have in Python?
- How to convert signed to unsigned integer in python
- How does the modulo (%) operator work on negative numbers in Python?
- Convert all strings in a list to integers
- Python floating point number comparison
- How to get largest possible precision? (Python – Decimal)
- Convert int to ASCII and back in Python
- What are some possible calculations with numpy or scipy that can return a NaN? [closed]
- How can I check if a string has a numeric value in it in Python? [duplicate]
- How do you get the next value in the floating-point sequence? [duplicate]
- How does Python implement the modulo operation?
- Print a float number in normal form, not exponential form / scientific notation [duplicate]