def days_in_month(month):
for m, nblist in month_days:
if month==m:
return nblist
else:
return []
days_in_month('May')
Out[20]: [31]
days_in_month('Mady')
Out[21]: []
solved Using the List Feature in Python
def days_in_month(month):
for m, nblist in month_days:
if month==m:
return nblist
else:
return []
days_in_month('May')
Out[20]: [31]
days_in_month('Mady')
Out[21]: []
solved Using the List Feature in Python