File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 computer = random .randint (1 , 3 )
2727
2828 if value not in valid :
29- Flag = False
30- print ('❌ Invalid choice! Rerun the game...\n ' )
31-
32- elif Flag :
33- print (f'\n 👤 You chose: { key [valid [value ]]} ' )
34- print (f'🤖 Computer chose: { key [computer ]} \n ' )
35-
36- if (valid [value ] == 1 and computer == 2 ) or (valid [value ] == 2 and computer == 3 ) or (valid [value ] == 3 and computer == 1 ):
37- print ('😢 You lost!! Better luck next time!\n ' )
38- elif valid [value ] == computer :
39- print ("🤝 It's a Tie!! Great minds think alike!\n " )
40- else :
41- print ('🎉 You won!! Congratulations!\n ' )
29+ print ('❌ Invalid choice! Please enter r, p, or s. Try again.\n ' )
30+ continue
31+
32+ print (f'\n 👤 You chose: { key [valid [value ]]} ' )
33+ print (f'🤖 Computer chose: { key [computer ]} \n ' )
34+
35+ if (valid [value ] == 1 and computer == 2 ) or (valid [value ] == 2 and computer == 3 ) or (valid [value ] == 3 and computer == 1 ):
36+ print ('😢 You lost!! Better luck next time!\n ' )
37+ elif valid [value ] == computer :
38+ print ("🤝 It's a Tie!! Great minds think alike!\n " )
39+ else :
40+ print ('🎉 You won!! Congratulations!\n ' )
4241
4342 response = str (input ('Continue playing? Yes(y) or No(n): ' )).lower ()
4443
You can’t perform that action at this time.
0 commit comments