Advertisement
Konark

Untitled

Apr 20th, 2020
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. from math import ceil, floor
  2.  
  3. x = float(input())
  4. y = float('{:.3f}'.format(x % 1))
  5. if abs(y) >= 0.5:
  6.     x = ceil(x)
  7. else:
  8.     x = floor(x)
  9.  
  10. print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement