d = {"apples": 1, "banannas": 4} # Preferably use .keys() when searching for a key if "apples" in d.keys(): print(d["apples"])