If I have 177 items, and each page has 10 items that means I'll have 18 pages.
I'm new to python and having used any of the math related functions.
How can I calculate 177/10 and then get round up so I get 18 and not 17.7
To calculate the page count for a 5.5″ × 8.5″ book: 10 pt type – divide your word count by 475. 11 pt type – divide your word count by 425. 12 pt type – divide your word count by 350.
total_items / 10 should give you the number of pages. You also need to consider remainder of the division (total_items % 10). So total pages would be total_items / 10 and 1 more in case remainder is > 0.
import math
math.ceil(float(177)/10)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With