I'm working on a project, and I have a team class made up of different player classes.
I want a function to create new players and add them to the team, but instead of naming the new player class something like newPlayer(), I want the class name to be the name of the player, so I don't run into issues if I create multiple new players and have a team of the same newPlayer()'s
For example, I want a function like this:
def createPlayer(player_name, player_skill):
class player_name:
skill = playerskill
player_name = player_name()
So if I run:
createPlayer('Mike', 10)
I will get a class named Mike, and I can get Mike's speed with team.Mike.speed
Is it possible to get something like this?