0

I made a solution for problemset 1, Meal Time from CS50P and I can't get a check from check50. The code works for me if I input the code myself but when I run check50 I get the error: I found the correct code here: Meal Time issues

But I can't find the problem in my code when I compare it with the code of the commentator.

My code:

def main():
    n = input("What time is it? ").split(":")
    answer = convert(n)
    if 7 <= answer <= 8:
        print("breakfast time")
    elif 12 <= answer <= 13:
        print("lunch time")
    elif 18 <= answer <= 19:
        print("dinner time")
    else:
        print("")
def convert(time):
    time = float(time[0]) + (float((time[1])) / 60)
    return time
if __name__ == "__main__":
    main()
1
  • Please include the error you got. Not a link to alleged correct code.
    – UpAndAdam
    Commented Dec 21, 2023 at 23:15

1 Answer 1

0

The spec says:

convert is a function (that can be called by main) that converts time, a str in 24-hour format...

In this program, convert takes a list.

1
  • I found the error. When I put the input in convert() there is no error so I think the program checks if convert() has input().
    – Yazkis
    Commented Dec 22, 2023 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .