0
How do we round off values in python?
?
9 Antworten
+ 4
https://code.sololearn.com/ceA3u1zBKs3b/?ref=app
value = 3.141592
print(round(value, 4))
result == > 3.1416
+ 3
Try using round() function
Learn more about it here👇
https://www.geeksforgeeks.org/round-function-JUMP_LINK__&&__python__&&__JUMP_LINK/
+ 2
5//3 = 1
+ 2
Thanks🙏
+ 1
from math import ceil
rounded_value = ceil(value)
+ 1
coder_20 You can make or convert that number in integer by using int() so it will automatically converted in round off
+ 1
coder_20 Use round(value to be round off, up to how many decimal place)
Example: volume=1289.4893
round(volume , 2)
Output: 1289.49
0
Suppose we get 1.9, it will return 1only won't it?
0
Thanks😊