Question
Please debug, I get an error after the player one name is entered. # Generate a random number import random # variables 2 players player1
Please debug, I get an error after the player one name is entered.
# Generate a random number
import random
# variables 2 players
player1 = input("Enter Player one name:")
player2 = input("Enter Player two name:")
#Set the counter
counter1 = 0
counter2 = 0
while (counter1 < 10 and counter2 < 10):
num1 = random.randint(1,13)
num2 = random.randint(1,13)
print((player1),"'s random number was",num1)
print((player2),"'s random number was",num2)
print()
if num1==num2:
print("Both number are equal")
print()
elif num1>num2:
counter1 = counter1 + 1
elif num2>num1:
counter2 = counter2 + 1
print((player1),"score is",(counter1))
print((player2),"score is",(counter2))
if counter1>counter2:
print((player1), "wins")
else:
print((player2), "wins")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started