>>> d = {'apples': 15, 'bananas': 35, 'grapes': 12}
>>> d['banana']
KeyError
myDict = {1: 1, 2: 4, 3: 9}
print("The dictionary is:", myDict)
key = 4
if key in myDict.keys():
print(myDict[key])
else:
print("{} not a key of dictionary".format(key))
1. Goto Pafy package directory for package directory click on below link and view on stackoverflow)
2. Open backend_youtube_dl.py file in any txt editor
3. comment line number 54
df.get('food')
Raised when a mapping (dictionary) key is not found in the set of existing keys.