Basic python arithmetic - division

后端 未结 6 793
眼角桃花
眼角桃花 2021-01-05 14:40

I have two variables : count, which is a number of my filtered objects, and constant value per_page. I want to divide count by per_page and get integer value but I no matter

6条回答
  •  心在旅途
    2021-01-05 15:40

    From Python documentation (math module):

    math.ceil(x)

    Return the ceiling of x as a float, the smallest integer value greater than or equal to x.

提交回复
热议问题