You can use the math.ceil()
function to round a number up to its nearest whole number (ceiling). Here's an example:
main.py85 chars7 lines
In this example, math.ceil(num)
returns 4
, which is the ceiling of the num
variable, and 4
is then assigned to the ceiling_num
variable. Finally, the print()
function is used to display the result.
gistlibby LogSnag