1d = {"apples": 1, "banannas": 4}
2# Preferably use .keys() when searching for a key
3if "apples" in d.keys():
4 print(d["apples"])
5
1# Check if key exists
2if session.get("key") == None:
3 # Do something if it doesnt exist
4else:
5 # Do something else if it does exist