-4

I want to convert the float values to next integer such as

x=1.1
print(x)

should return 2

and it also make 1.9 to 2.

any help shall be appreciated.

Talha Anwar
  • 43
  • 1
  • 5

2 Answers2

1
import math
math.ceil(1.1)
# 2
deathangel908
  • 6,985
  • 7
  • 38
  • 73
1
import math
x=1.1
print(math.ceil(x))
# 2
Jacob Tomlinson
  • 3,083
  • 2
  • 29
  • 58