I have a dictionary and I would like to get some values from it based on some keys. For example, I have a dictionary for users with their first name, last name, username, ad
Use .get(), which if the key is not found, returns None.
.get()
None
for i in keySet: temp = myDict.get(i) if temp is not None: print temp break