The Python Oracle

Why dict.get(key) instead of dict[key]?

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

--

Track title: CC D Schuberts Piano Sonata D 850 in D

--

Chapters
00:00 Question
00:35 Accepted answer (Score 1494)
01:16 Answer 2 (Score 224)
04:18 Answer 3 (Score 37)
04:47 Answer 4 (Score 30)
05:25 Thank you

--

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

Answer 1 links:
[From the documentation]: https://docs.python.org/3/library/stdtyp...
[here]: https://wiki.python.org/moin/PythonSpeed...
[timeit]: https://docs.python.org/3/library/timeit...
[dis]: https://docs.python.org/3/library/dis.ht...
[__missing__]: https://docs.python.org/3/reference/data...

--

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

--

Tags
#python #dictionary

#avk47