SyntaxFix
Write A Post
Hire A Developer
Questions
You don't have to call keys:
if 'key1' in dict: print("blah") else: print("boo")
That will be much faster as it uses the dictionary's hashing as opposed to doing a linear search, which calling keys would do.