HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How to get all the keys from a dictionary in Python

8,857 views October 29, 2018 1:30

Watch on YouTube
ChannelEnthought

Description from the creator

In this short tutorial, you will learn how to extract all the keys from a dictionary in Python, and how to use them with set operations. Want to learn more? See our Python classes at goo.gl/Y3H7Uz.

Read the documentation for dict views here: docs.python.org/3/library/stdtypes.html#diction…
Read the documentation for sets here: docs.python.org/3/library/stdtypes.html#set-typ…

Code from video:
*****************
employees = {1: 'michael', 2: 'eric', 3: 'michael'}
employees.keys()
employees.keys() & {2, 3}

Connect with us!
*****************
twitter.com/enthought
facebook.com/Enthought/
linkedin.com/company/enthought

About this tutorial

Enthought published this 1:30 video tutorial on October 29, 2018. It has been watched 8,857 times on YouTube.

Channel
Enthought
Duration
1:30
Published
October 29, 2018
Views
8,857
Likes
49

Tags

Share

This tutorial in other languages