python como verificar se existe uma chave de dicionário
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.')