Skip to main content
added 14 characters in body
Source Link
UpAndAdam
  • 1.7k
  • 1
  • 3
  • 20

try this.

def main(): time = input("What time is it? ").strip() converted_time = convert(time) if 7 <= converted_time <= 8: print("breakfast time") elif 12 <= converted_time <= 13: print("lunch time") elif 18 <= converted_time <= 19: print("dinner time") else: print("")

def convert(time): x, y = map(int, time.split(":")) converted_time = x + y/60 return converted_time

def main():
    time = input("What time is it? ").strip()
    converted_time = convert(time)
    if 7 <= converted_time <= 8:
        print("breakfast time")
    elif 12 <= converted_time <= 13:
        print("lunch time")
    elif 18 <= converted_time <= 19:
        print("dinner time")
    else:
        print("")

def convert(time):
    x, y = map(int, time.split(":"))
    converted_time = x + y/60
    return converted_time

try this.

def main(): time = input("What time is it? ").strip() converted_time = convert(time) if 7 <= converted_time <= 8: print("breakfast time") elif 12 <= converted_time <= 13: print("lunch time") elif 18 <= converted_time <= 19: print("dinner time") else: print("")

def convert(time): x, y = map(int, time.split(":")) converted_time = x + y/60 return converted_time

try this.

def main():
    time = input("What time is it? ").strip()
    converted_time = convert(time)
    if 7 <= converted_time <= 8:
        print("breakfast time")
    elif 12 <= converted_time <= 13:
        print("lunch time")
    elif 18 <= converted_time <= 19:
        print("dinner time")
    else:
        print("")

def convert(time):
    x, y = map(int, time.split(":"))
    converted_time = x + y/60
    return converted_time

Source Link

try this.

def main(): time = input("What time is it? ").strip() converted_time = convert(time) if 7 <= converted_time <= 8: print("breakfast time") elif 12 <= converted_time <= 13: print("lunch time") elif 18 <= converted_time <= 19: print("dinner time") else: print("")

def convert(time): x, y = map(int, time.split(":")) converted_time = x + y/60 return converted_time