This code always gives an error 'examine not defined', I don't know why
def get_input(): command=input('3nter phrase : ').split() verb_word=command[0] if verb_word in verb_dict: verb=verb_dict[verb_word] else: print(f'Unknown verb ({verb_word})') return if len(command) >= 2: noun_word=command[1] print(verb(noun_word)) else: print(verb('Nothing')) def say(noun): return f'You said {noun}' verb_dict={ 'say' : say, 'examine' : examine, } while True: get_input() class GameObject: class_name = '' desc = '' objects = {} def __init__(self,name): self.name=name GameObject.objects[self.class_name]=self def get_desc(self): return self.class_name + '\n' + self.desc class Goblin(GameObject): class_name = 'goblin' desc = 'a foul creature' goblin=Goblin('gobbly') def examine(noun): if noun in GameObject.objects: return GameObject.objects[noun].get_desc() else: print(f'There is no {noun} here')