H
H
heshhe2020-06-08 21:49:55
Python
heshhe, 2020-06-08 21:49:55

How to find an object in a dictionary inside a dictionary?

There is a dictionary:
dict_oid = { 'Basic electronic signature':
[{'1.3.6.1.5.5.7.3.2': 'Client authentication',
'1.3.6.1.5.5.7.3.4': 'Secure email',
'1.2.643.2.2.34.6':'Registration Center User, HTTP, TLS Client',
'1.2.643.2.2.34.25':'Update Status Service User',
'1.2.643.2.2.34.25':' Time stamp service user',
'1.2.643.3.89.24':'Roskomnadzor (rkn.gov.ru)',
'1.2.643.2.64.1.1.1':'EFRSDYuL',
"1.2.643.6.37.1.1":' SEP user: registration of a legal entity/individual entrepreneur, editing, delegation',
'1.2.643.3.157.2.13':'ETP Siberian trading platform',
'1.2.643.6.41.1.1.1': 'Participant with the right to disclose information ("Interfax - TsRKI")',
'1.2.643.6.45.1.1.1':'Participant with the right to disclose information (Analysis, Consulting and Marketing CJSC)',
'1.2.643.6.44.1.1.1':'Participant with the right to disclose information (ANO "AZIPI")',
'1.2.643.6.42.5.5.5':'Participant with the right to disclose information (JSC AEI PRIME)',
'1.2.643.6.40.1':'Participant with the right to disclose information (JSC "SKRIN")'
}]
}

The user enters the value: '1.3.6.1.5.5.7.3.2'
.. and should get the result: Basic electronic signature, Client authentication

How to implement a search?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-06-08
@heshhe

dict_oid = { 'Базовая электронная подпись':
Тут словарь
}

data = input('Введите данные: ')

print(dict_oid['Базовая электронная подпись'][0].get(data,'Ошибка!'))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question