R
R
Rasul_i2020-04-13 21:30:06
Python
Rasul_i, 2020-04-13 21:30:06

How to get one of the key value in a dictionary?

please tell me my code is not working

slovar = {'one':'11',
          'two':['aaa','bbb','ccc'],
          'tree':'три'
          }

r = slovar['two'].index(1)

print(r)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yerdnaandrey, 2020-04-13
@Rasul_i

slovar = {'one':'11',
          'two':['aaa','bbb','ccc'],
          'tree':'три'
          }

print(slovar['two'][1])

I think like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question