I'm trying to make a system where a user chooses how many bots he wants to face against from 1 to 3 in a game but I'm having a hard time figuring out how to automatically create the bots using the given value as a name.
while True:
try:
Player_Count = int(input("How many bots do you want to play against from 1 - 3?"))
except ValueError:
print("That's not a number! Try again!")
else:
if 1 <= Player_Count <= 3:
break
else:
print("Out of Range! Try Again")
That part works fine, but I can't figure out how to use the Player_Count variable as a name for the lists (The data for the bots will be stored in those lists.)
I've did this but it's a pretty bad way to do that, I suppose:
for bot in range(Player_Count):
if bot == 0:
bot1 = []
if bot == 1:
bot2 = []
if bot == 2:
bot3 = []
Any help will be greatly appreciated!