Question: Keep getting the error: print ( Enter a name for player + ( i + 1 ) + : ) TypeError: can
Keep getting the error:
printEnter a name for player" i :
TypeError: can only concatenate str not "int" to str
Need help avoiding this error throughout all this code:
import random
random.seed #Prepare random number generator
newTeams y
playerName
i
numPlayers
printEnter the number of players:"
numPlayers intinput
playerList numPlayers
while i numPlayers:
printEnter a name for player" i :
playerName input
playerListi playerName
i i
printTotal players entered:" numPlayers
while newTeams y:
court
sittingOut
for i in range numPlayers :
j intrandomrandomnumPlayers
temp playerListi
playerListi playerListj
playerListj temp
for i in range numPlayers :
if numPlayers i :
printPlayer sitting out."
print
k numPlayers
while k i:
sittingOut sittingOut playerListk
k k
printsittingOut
else:
printPlayers on court" court :
print
printplayerListi & playerListi vs playerListi & playerListi
court court
printcreate new teams y or n
newTeams input
while newTeams y and newTeams n:
printError Create New teams y or n
newTeams input
printGoodbye
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
