I'm trying to make a dive table that has some numbers that aren't in a pattern that I can see so I have to manually add all the values, but I need to grab the input and round it to the nearest number in the dictionary.
I'll need to convert the input back to string for the output to be correct:
CODE:
class DepthTable:
def __init__(self):
self.d35 = {"10": "A",
"19": "B",
"25": "C",
"29": "D",
"32": "E",
"36": "F",
}
def getpressureGroup(self, depth, time):
if depth == "35":
output = self.d35[time]
else:
output = "No info for that depth"
print(output)
if __name__ == "__main__":
depthtable = DepthTable()
print("Please enter Depth (Use numbers!)")
depth = input()
print("Please Enter time!")
time = input()
depthtable.getpressureGroup(depth,time)
So when the "player" inputs the number 15 for time, I need to round it UP to 19 (Always up even if it's 13 or something like that.) I don't see how I can do this with round() or I might have to make a function that checks EVERY number..