How do I avoid KeyError when working with dictionaries?
You generally use .get with a default get(key[, default]) Return the value for key if key is in the dictionary, else default. If default is not given, it defaults to None, so that this method never raises a KeyError. So when you use get the loop would look like this: for item in newS: functionField … Read more