Answer the question
In order to leave comments, you need to log in
How to find the dictionary key by index?
Schedule = {'Monday':'', 'Tuesday':'', 'Wednesday':'', 'Thursday':'', 'Friday':''}
I have a dictionary /\
And I have index 3
How do I extract a key by index, without lists?
Answer the question
In order to leave comments, you need to log in
No way. Read about dictionaries. information is not organized. You can't access the index. Only by key.
So there is no list here. Create a list days = [Monday. Tuesday, Wednesday...]
and get the data from the dictionary via Schedule.get(days[i-1])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question