1 import random 2 3 user_points = 0 4 computer_points = 0 5 play = 'y' 6 while play == 'y': 7 computer = random.randrange (1,7) 8 user = int(input ("Guess a number between 1 and 6:")) 9 if user == computer: 10 print("You win and earn 10 points.") 11 #user_points = user_points + 10 12 user_points = user_points + 10 13 else: 14 print("Computer wins and earns 10 points") computer_points + 10 15 #computer_points 16 computer_points += 10 17 18 19 20 21 22 23 24 25 26 play=input("Do you want to continue (y/n):") 27 print(" 28 print(" 29 print(". .") 30 print (f"Game was played {count} times") 31 print (f"comuter earned {computer_points} points.") 32 print (f"You earned {user_points} points.") count += 1 Scoreboard

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

how do i fix this in python??

1 import random
2
3 user_points = 0
4 computer_points = 0
5 play = 'y'
6 while play == 'y':
7 computer = random.randrange (1,7)
8 user = int(input("Guess a number between 1 and 6:"))
if user == computer:
9
10 print("You win and earn 10 points.")
11
#user_points = user_points + 10
12 user_points = user_points + 10
13 else:
14 print("Computer wins and earns 10 points")
15 #computer_points = computer_points + 10
16 computer_points += 10
17
18
19
20 count += 1
21
22
23
24
25
26 play=input("Do you want to continue (y/n):")
27 print("
28 print("
Scoreboard
")
")
")
29 print("
30 print (f"Game was played {count} times")
31 print (f"comuter earned {computer_points} points.")
32 print (f"You earned {user_points} points.")
33
Transcribed Image Text:1 import random 2 3 user_points = 0 4 computer_points = 0 5 play = 'y' 6 while play == 'y': 7 computer = random.randrange (1,7) 8 user = int(input("Guess a number between 1 and 6:")) if user == computer: 9 10 print("You win and earn 10 points.") 11 #user_points = user_points + 10 12 user_points = user_points + 10 13 else: 14 print("Computer wins and earns 10 points") 15 #computer_points = computer_points + 10 16 computer_points += 10 17 18 19 20 count += 1 21 22 23 24 25 26 play=input("Do you want to continue (y/n):") 27 print(" 28 print(" Scoreboard ") ") ") 29 print(" 30 print (f"Game was played {count} times") 31 print (f"comuter earned {computer_points} points.") 32 print (f"You earned {user_points} points.") 33
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY