Feb-18-2022, 01:20 PM
Hello world,
I need your help for my new game project.
I want to use x(the number of player) time my class Player.
I think do that but it's not optimum.
Except that I need to do this for each round of the game.
Can you recommend something better?
Thank you in advance.
I need your help for my new game project.
I want to use x(the number of player) time my class Player.
I think do that but it's not optimum.
1 2 3 4 5 |
from MyClass import Player x = int ( input ( "Number of player: " )) for i in range ( 1 , x + 1 ): exec ( f "Player{i} = Player()" ) |
Can you recommend something better?
Thank you in advance.