0

GAME

def get_input(): command = input(": ").split() verb_word = command[0] if verb_word in verb_dict: verb = verb_dict[verb_word] Please help me understand verb = verb_dict[verb_word]

15th Jan 2018, 12:56 PM
sumit
sumit - avatar
1 Réponse
0
it's basically extraction of value using a key say I have a dictionary d={'hello':'world'} where key-->hello and value-->world so print d['hello'] prints world similarly in your code you are checking if a word exist or not in dictionary and extracting it's value if exist
16th Jan 2018, 5:16 PM
Pavan Kumar T S
Pavan Kumar T S - avatar