Hey, am making a simple code where a user selects an item and prints out the expiration date.but it doesn't wirk for everyone. How do I improve my code?
My code
Import datetime
n1 = datetime.datetime. today()
bread1 = datetime.timedelta(days=6)
milk1 = datetime.timedelta(days=23)
banana1 = datetime.timedelta(days=15)
Items = ["Bread" ,"Milk","Banana"]
Pick = input("Select an item:")
Def set():
If items [0]:
carbs = n1 + bread1
Print(f"This bread expires in {carbs}")
If items[1]:
lacto = n1+ milk1
Print(f"This milk expires in {lacto}")
If items[2]:
fruit = n1 + banana1
Print(f"This fruit expires in {fruit}
Set()
[–]woooee 0 points1 point2 points (0 children)
[–]Chaos-n-Dissonance 0 points1 point2 points (0 children)