Python Bagaimana cara memeriksa apakah ada kunci kamus
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.')