0
Dictionary
So i have a dictionary and user input as an int and i want to know if the first thing in the dictionary corresponds to 0 and the second as 1 and so on. Is there a way to get that?
3 Respostas
+ 1
i=0
while i<len(dictionary)
{
if dictionary[i] == 1:
#doSomething
else:
#doSomethingElse
}
0
@HB Damienz Thank you
- 1
This Tutorial answer quite good to your question.
Indexes for dictionary , lists and tuples start from zero.