-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

2
import math
math.ceil(1.1)
# 2
deathangel908
  • 8,601
  • 8
  • 47
  • 81
1
import math
x=1.1
print(math.ceil(x))
# 2
Jacob Tomlinson
  • 3,341
  • 2
  • 31
  • 62