Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to round a number up in python

>>> import math

>>> math.ceil(3.2) # round up
4
Comment

how to round whole numbers in python

#To round decimals
round(123.4)
#To select the significant number you whish to round to
#add extra parameter
round(12.456, 2)
#To round whole numbers
round(1236, -1)
Comment

PREVIOUS NEXT
Code Example
Python :: discord py server.channels 
Python :: how to split a string by colon in python 
Python :: encode url 
Python :: how to turn a string into an integer python 
Python :: numpy.sort 
Python :: python tkinter focus on entry 
Python :: split range python 
Python :: replace nan in pandas column with mode and printing it 
Python :: sum up list python 
Python :: check if a value is in index pandas dataframe 
Python :: python reverse range 
Python :: convert a list to tuple 
Python :: show percentage in seaborn countplot site:stackoverflow.com 
Python :: onehot encode list of columns pandas 
Python :: pyspark on colab 
Python :: python ignore first value in generator 
Python :: pairs with specific difference 
Python :: Sort index values with pandas 
Python :: single line return python 
Python :: test pypi 
Python :: what does abs do in python 
Python :: pyautogui 
Python :: python in 
Python :: Multiple list comprehension 
Python :: python list clear vs del 
Python :: python pytest vs unittest 
Python :: deque in python 
Python :: split dataframe row on delimiter python 
Python :: logistic regression sklearn 
Python :: python create a global variable 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =