Upload files to "basic programming/1st task"

This commit is contained in:
2024-11-23 15:48:40 +02:00
parent b4ef6ebbac
commit a3e834c190
5 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# Q8
# Imports
import math
# Get value from user
number = float(input("Enter float with 5 or more decimal digits: "))
# Calculate ceiling and floor
number_ceiling = math.ceil(number)
number_floor = math.floor(number)
# Round number
number_rounded = round(number, 2)
# Print results
for variable in [number_floor, number_ceiling, number_rounded]:
print(variable)