Skip to content

Commit e1e32ca

Browse files
committed
meal
1 parent 18987fb commit e1e32ca

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Problem Set 1/meal/meal.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
def main():
2+
time = input("What time is it? ")
3+
x = convert(time)
4+
if 7.00 <= x <= 8.00:
5+
print("breakfast time")
6+
elif 12.00 <= x <= 13.00:
7+
print("lunch time")
8+
elif 18.00 <= x <= 19.00:
9+
print("dinner time")
10+
11+
12+
13+
def convert(time):
14+
15+
x, y = time.split(":")
16+
17+
float_x = float(x)
18+
float_y = float(y) / 60
19+
20+
float_time = float_x + float_y
21+
return float_time
22+
23+
if __name__ == "__main__":
24+
main()

0 commit comments

Comments
 (0)