I'm doing the problem set 1 on CS50P course and on the "Meal Time" problem I can't get a check from check50.
The code runs fine if I test manually but check50 returns 'cant check until a frown turns upside down' on every test after the second one (which doesn't pass).
I made some mistake for sure but the code runs fine so there must be something I'm missing?
time = input("What time is it?: ")
def main(x):
x = convert(x)
if x >= 7 and x <= 8.00 :
print("breakfast time")
elif x >= 12 and x <= 13 :
print("lunch time")
elif x >= 18 and x <= 19 :
print("dinner time")
def convert(x):
if ":" in x :
x = x.split(":")
x = (int(x[1]) / 60) + int(x[0])
return float(x)
main(time)
if __name__ == "__main__":
main()