i am trying to have a code to give me a list of meals and put the day i will be having this. but when i run it it put its out the same item for the week and repeats that with the next meal. not sure how to fix this.
monday: random meal
tuesday: random meal
wednesday: random meal
thursday: random meal
friday: random meal
saturday: random meal
sunday: random meal
import pandas as pd
import random
def main():
# I want to do for this code is to random meals per week and put in my done Excel file to go shopping.
# grab list of meals to make.
db = pd.read_excel("meals.xlsx")
week_days = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]
for i in db.index:
random_item = [db["meals"].loc[i]]
random_item = random.choice(random_item)
for i in week_days:
print(f"{i}: {random_item}")
if __name__ == "__main__":
main()
but it double and if i add more to the list it just adds more to the list.
monday: Chicken & Veggie Stir-fry
tuesday: Chicken & Veggie Stir-fry
wednesday: Chicken & Veggie Stir-fry
thursday: Chicken & Veggie Stir-fry
friday: Chicken & Veggie Stir-fry
saturday: Chicken & Veggie Stir-fry
sunday: Chicken & Veggie Stir-fry
monday: Easy Butter Chicken
tuesday: Easy Butter Chicken
wednesday: Easy Butter Chicken
thursday: Easy Butter Chicken
friday: Easy Butter Chicken
saturday: Easy Butter Chicken
sunday: Easy Butter Chicken
not really sure know how to fix this.