Reputation: 169
I have to write a function day_to_number(day)
that takes the supplied global list day_list
and returns the position of the given day in that list. I can't seem to make it work.
Here is my code.
day_list = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
def day_to_number(day):
for day in day_list:
return day_list.index(day)
print day_to_number("Saturday")
Thanks for the help in advance
Upvotes: 0
Views: 472