Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2) Print a list of all those medicine which has expired in the below dictionary medicine ** Key of this dictionary is medicine name and
2) Print a list of all those medicine which has expired in the below dictionary medicine ** Key of this dictionary is medicine name and values is expiry date. Write a function name it expired_medication which takes this dictionary as an input and outputs the expired medicine names [] medicine_dict = { "Abelcet":"Aug 1 2016", "Azithromycin":"Dec 24 2021", "Arava":"Jan 1 2017", "Arixtra": "May 31 2820", "Aplenzin":"Jan 3 2016", "Antizol":"Aug 31 2016", "Anadrol-52":"Nov 14 2021" } [] # Solution here [4] import datetime medicine - "Abelcet":"Aug 1 2016", "Azithromycin":"Dec 24 2021", "Arava":"Jan 1 2017", "Arixtra":"May 31 2020", "Aplenzin":"Jan 3 2016", "Antizol":"Aug 31 2016", "Anadrol -50":"Nov 14 2021" } def expiredMed (medicine): res1 curr_date - datetime.date.today().strftime("%b %d %Y") curr_date = datetime.datetime. strptime(curr_date, "% %d %Y") for k, v in medicine. items(): V = datetime.datetime.strptime(v, "%b %d %Y") if(v", line 15 res - 0 IndentationError: expected an indented block SEARCH STACK OVERFLOW
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started