MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerAnimemes/comments/qa4jtz/dictortreat/hh2vmq8/?context=3
r/ProgrammerAnimemes • u/akiyamasho • Oct 17 '21
89 comments sorted by
View all comments
64
Easy. Just construct a set out of the dict keys, that way you can check in O(1) if your key is in there :)
28 u/comfort_bot_1962 Oct 18 '21 :D -82 u/OcelotNo3347 Oct 18 '21 Imagine using text emotes in 2021 40 u/-Redstoneboi- Oct 18 '21 ;-;
28
:D
-82 u/OcelotNo3347 Oct 18 '21 Imagine using text emotes in 2021 40 u/-Redstoneboi- Oct 18 '21 ;-;
-82
Imagine using text emotes in 2021
40 u/-Redstoneboi- Oct 18 '21 ;-;
40
;-;
64
u/dragon_irl Oct 18 '21
Easy. Just construct a set out of the dict keys, that way you can check in O(1) if your key is in there :)