-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject_1v3.py
More file actions
68 lines (61 loc) · 1.62 KB
/
Project_1v3.py
File metadata and controls
68 lines (61 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import random
Player_Score = 0
Computer_Score = 0
Rounds = 3
print("Welcome to Rock Paper Scissors Game") #On-screen welcome message
while Player_Score < Rounds and Computer_Score < Rounds:
print(f"Current Score: {Player_Score}, {Computer_Score}")
Player = input("Player, enter your choice: ")#.lower() #Collects user input
rand_num = random.randint(0,2)
if (rand_num == 0):
Computer = "Rock"
elif (rand_num == 1):
Computer = "Paper"
else:
Computer = "Scissors"
print(f"Computer plays: {Computer}")
#Conditional Statements
if Player == Computer:
print("It's a tie!")
elif Player == "Rock":
if Computer == "Paper":
print("Computer Wins")
Computer_Score += 1
elif Computer == "Scissors":
print("Player Wins")
Player_Score += 1
elif Player == "Paper":
if Computer == "Scissors":
print("Computer Wins")
Computer_Score += 1
elif Computer == "Rock":
print("Player Wins")
Player_Score += 1
elif Player == "Scissors":
if Computer == "Rock":
print("Computer Wins")
Computer_Score += 1
elif Computer == "Paper":
print("Player Wins")
Player_Score += 1
else: print("Oops! Something went wrong")
print(f"Final Score: {Player_Score}, {Computer_Score}")
# if Player == Computer:
# print("It's a tie!")
# elif Player == "rock":
# if Computer == "paper":
# print("Computer Wins")
# else:
# print("Player Wins")
# elif Player == "paper":
# if Computer == "scissors":
# print("Computer Wins")
# else:
# print("Player Wins")
# elif Player == "scissors":
# if Computer == "rock":
# print("Computer Wins")
# else:
# print("Player Wins")
#else:
# print("Oops! Wrong move")