Question: Can you please change the code below in a different way but same inputs. import random def play _ game ( ) : player 1
Can you please change the code below in a different way but same inputs.
import random
def playgame:
playername inputEnter player name:
playername inputEnter player name:
roundstoplay intinputNo of rounds to play:
playerscore
playerscore
for roundnum in range roundstoplay :
playerroundscore random.randint
playerroundscore random.randint
printfRound roundnumplayernameplayerroundscore : playernameplayerroundscore
playerscore playerroundscore
playerscore playerroundscore
printfCurrent Score playernameplayerscore : playernameplayerscore
if playerscore playerscore:
printfplayername is the winner!!"
elif playerscore playerscore:
printfplayername is the winner!!"
else:
printIts a draw!!"
# Run the game
playgame
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
