SyntaxFix
Write A Post
Hire A Developer
Questions
This is a very common looping idiom. in is an operator. For when to use for key in dict and when it must be for key in dict.keys() see David Goodger's Idiomatic Python article (archived copy).
in
for key in dict
for key in dict.keys()