6
6
import re
7
7
os .system ('cls' if os .name == 'nt' else 'clear' )
8
8
while (1 < 2 ):
9
- print "\n "
10
- print "Rock, Paper, Scissors - Shoot!"
11
- userChoice = raw_input ("Choose your weapon [R]ock], [P]aper, or [S]cissors: " )
9
+ print ( "\n " )
10
+ print ( "Rock, Paper, Scissors - Shoot!" )
11
+ userChoice = input ("Choose your weapon [R]ock], [P]aper, or [S]cissors: " )
12
12
if not re .match ("[SsRrPp]" , userChoice ):
13
- print "Please choose a letter:"
14
- print "[R]ock, [S]cissors or [P]aper."
13
+ print ( "Please choose a letter:" )
14
+ print ( "[R]ock, [S]cissors or [P]aper." )
15
15
continue
16
- // Echo the user 's choice
17
- print "You chose: " + userChoice
16
+ # Echo the user's choice
17
+ print ( "You chose: " + userChoice )
18
18
choices = ['R' , 'P' , 'S' ]
19
19
opponenetChoice = random .choice (choices )
20
- print "I chose: " + opponenetChoice
20
+ print ( "I chose: " + opponenetChoice )
21
21
if opponenetChoice == str .upper (userChoice ):
22
- print "Tie! "
22
+ print ( "Tie! " )
23
23
#if opponenetChoice == str("R") and str.upper(userChoice) == "P"
24
24
elif opponenetChoice == 'R' and userChoice .upper () == 'S' :
25
- print "Scissors beats rock, I win! "
25
+ print ( "Scissors beats rock, I win! " )
26
26
continue
27
27
elif opponenetChoice == 'S' and userChoice .upper () == 'P' :
28
- print "Scissors beats paper! I win! "
28
+ print ( "Scissors beats paper! I win! " )
29
29
continue
30
30
elif opponenetChoice == 'P' and userChoice .upper () == 'R' :
31
- print "Paper beat rock, I win! "
31
+ print ( "Paper beat rock, I win! " )
32
32
continue
33
33
else :
34
- print "You win!"
34
+ print ( "You win!" )
0 commit comments