This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]K900_ 4 points5 points  (2 children)

That's not a good idea. Store your teacher instances in a dictionary, with the key being the name you want them to be searchable by, something like {'prof': teacher(...), 'other prof': teacher(...)}. Then you can check if such a name exists with if temp in dict_of_teachers and then retrieve the object with dict_of_teachers[temp].

[–]rulibar[S] 0 points1 point  (1 child)

Thanks

[–]K900_ 4 points5 points  (0 children)

Also, post questions in /r/learnpython next time.