The Python Oracle

How to check if a variable is a dictionary in Python?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 3

--

Chapters
00:00 Question
00:32 Accepted answer (Score 439)
00:52 Answer 2 (Score 87)
04:01 Answer 3 (Score 7)
04:16 Answer 4 (Score 4)
04:34 Thank you

--

Full question
https://stackoverflow.com/questions/2523...

Accepted answer links:
[isinstance(ele, dict)]: https://docs.python.org/2/library/functi...

Answer 2 links:
[object identity]: https://docs.python.org/3/library/stdtyp...

Answer 4 links:
[here]: https://stackoverflow.com/questions/3708...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #dictionary

#avk47