Forgive me if this question is a repeat, but I'm stuck with a code I've been working on. I am creating a program for myself to create random teams of people, and I've been trying to find an easy way to make an inserted amount of teams. The area I am suck on is here:
print("How many teams would you like?")
numberteam = input("Number: ")
listnumber = 0
teams = []
while numberteam + 1:
teams.append(Team(str(listnumber + 1)) = [])
I am a fairly new coder, so I'm sure besides the obvious using an expression for a variable there are probably other mistakes, but any suggestions on an easy way to fix this would be great!
Also if I left something out, please just ask! (By the way I am using python)
random.shuffleand list slicing would be your best bet...while numberteam + 1:isn't doing what you expect. It is adding 1 tonumberteam, then discards the value.numberteamis not being updated.