-
Notifications
You must be signed in to change notification settings - Fork 0
/
meal-planner.py
48 lines (39 loc) · 990 Bytes
/
meal-planner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
Meal Planner version 1.0
Creator: Beaux Walton
"""
# Import libraries and modules.
import random
# Single serve meals.
meals = [
'Tofu Bowl', 'Salmon', 'Balls and Salad', 'Homemade Pizza', 'Random choice', 'Pasta', 'Cauliflower Tacos', 'Butter Cauliflower', 'Nachos', 'Stirfry', 'Wraps', 'Pulled Carrot', 'Mac and Cheese'
]
# Meals that cover 2 nights.
bigMeals = [
'Chicken Salad', 'Perogies', 'Veggie Burgers'
]
# This option includes big meal.
def save():
week = random.sample(meals, 5)
for meal in week:
print(meal)
bigMeal = random.choice(bigMeals)
print(f'{bigMeal} x 2')
# This option offers a different meal each night.
def variety():
week = random.sample(meals, 7)
for meal in week:
print(meal)
# This randomly decides if a big meal is included.
def show():
repeat = bool(random.getrandbits(1))
if repeat:
save()
else:
variety()
# Provides output based on number of weeks (variable i).
i = 1
while i <= 12:
print(f'\nWeek {i}:')
show()
i += 1