I am having a bit of a problem with my rock, paper, scissors game. I'm trying to make the for
loop work but when there's a tie, it won't print what I wrote.
import random
#main function
def main():
for game_count in range(5):
answer = int(input("Enter 1 for Rock, 2 for Paper, 3 for Scissors: "))
number = random.randrange(1,4)
if answer == 1:
position = "rock"
print("You choose", position)
elif answer == 2:
position = "paper"
print("You choose", position)
elif answer == 3:
position = "scissors"
print("You choose", position)
else:
print("pick either 1, 2, or 3")
return main()
#computer picks what to play
if number == 1:
print("Computer chooses Rock")
elif number == 2:
print("Computer chooses Paper")
elif number == 3:
print("Computer chooses Paper")
return number
#if there is a tie
if answer == number:
print("It's a tie. Go again")
main()