Get a key
📁 dictionary, string, Advanced Python Topics
There is a dictionary:
d = {'a': '1', 'b': '2', 'c': '3'}
There is a string:
stroka = 'a3a2c'
If an element is among the dictionary values, it is necessary to output the key value; if among the keys, then output the value of that key. Output in two lines, values separately from keys.
i.e. I figured out:
No answers yet.
Log in to leave an answer
Blogs
Security of Rust Applications: Top 10 Vulnerabilities
Monorepo with Go: Code Organization for Scalable Projects
mysql_fetch_array() Error: Parameter 1 Must Be a Resource — Solution
Working with JSON in C++: Parsing and Serialization in Practice