I got a question of how I can call a function of an object.
Here is how I can call a function with userinput:
Player1 = Player()
Player2 = Player()
INPUT = input()
if INPUT in locals().keys():
try:
print(locals()[INPUT]())
but I want to call for example Player1.status() (You dont need to know what it does, I just want to call it)
It doesnt work and I know why it doesnt work but how does it work?
And calling Player1 makes no sense obviously.
dictorlistinstead of individually numbered variables andlocals()."It doesnt work"is not a good description of the symptoms. Also, you should break down your last line into separate concepts so you can tell what you mean.