Python, jak sprawdzić, czy istnieje klucz słownika
if word in data:
return data[word]
else:
return "The word doesn't exist. Please double check it."
Panicky Parrot
if word in data:
return data[word]
else:
return "The word doesn't exist. Please double check it."
# @Panicky Parrot
return data.get(word, 'The word doesn't exist. Please double check it.')