Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

4. Compare and contrast the practices of the two companies.

Answered: 1 week ago