Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,846 questions

51,767 answers

573 users

How to get the ceiling of N (the smallest integer not less than N) in Python

1 Answer

0 votes
import math

print(math.ceil(21.18))
print(math.ceil(-21.18))
print(math.ceil(10.13))
print(math.ceil(10.79))
print(math.ceil(math.pi))
print(math.ceil(120))
print(math.ceil(0.1))
print(math.ceil(0.3))
print(math.ceil(0.7))
print(math.ceil(0.08))


'''
run:

22
-21
11
11
4
120
1
1
1
1

'''

 



answered Oct 11, 2017 by avibootz
...