Playback starts YouTube’s embedded player (privacy-enhanced mode).
How to get a key from a value in Python
ChannelEnthoughtDescription from the creator
Read the documentation for list comprehensions here: docs.python.org/3/tutorial/datastructures.html#…
Code from video:
*****************
employees = {1: 'michael', 2: 'eric', 3: 'michael'}
[number for number, name in employees.items() if name == 'michael']
Connect with us!
*****************
twitter.com/enthought
facebook.com/Enthought/
linkedin.com/company/enthought
About this tutorial
Enthought published this 1:38 video tutorial on October 25, 2018. It has been watched 42,049 times on YouTube.
- Channel
- Enthought
- Category
- Science & Technology
- Duration
- 1:38
- Published
- October 25, 2018
- Views
- 42,049
- Likes
- 263
Tags
Share
Further reading
-
How to Extract Key from Python Dictionary using Value | by ...
towardsdatascience.com
Four methods to extract keys from python dictionary given value. Abhijith Chandradas. Nov 7 · 3 min read. It is straight-forward to extract value if we have key, like unlocking a lock with a key. However, the vice versa…
-
Python | Get key from value in Dictionary - GeeksforGeeks
geeksforgeeks.org
Let’s see how to get the key by value in Python Dictionary. Method #1: Using list.index() The index() method returns index of corresponding value in a list. . Below is an implementation how to use index() method to fetc…
-
Get key from value in Dictionary in Python
tutorialspoint.com
Python dictionary contains key value pairs. In this article we aim to get the value of the key when we know the value of the element. Ideally the values extract ...
This tutorial in other languages
- FRComment obtenir une clé d'une valeur en Python
- ESCómo obtener una clave de un valor en Python
- PTComo obter uma chave de um valor em Python
- ITCome ottenere una chiave da un valore in Python
- DEWie man einen Schlüssel von einem Wert in Python erhalten
- NLHoe maak je een sleutel van een waarde in Python te krijgen
- RUКак получить ключ от значения в Python
- PLJak uzyskać klucz od wartości w Pythonie
- JAPythonでの値からキーを取得する方法
- ARكيفية الحصول على مفتاح من قيمة في بيثون
- HIकैसे पायथन में एक मूल्य से एक चाबी पाने के लिए
- IDCara mendapatkan kunci dari nilai di Python