Jan-16-2018, 08:01 PM
GAME UPDATE
Can anyone guide me of how to fix the error that im having of, trying to end the game after 3 turns and telling the users that they both choose the same thing?
Can anyone guide me of how to fix the error that im having of, trying to end the game after 3 turns and telling the users that they both choose the same thing?
player = input("whats your name: ") player1 = input("whats your name: ") guess_same=[] def game(): choose= input(player+ " choose rock, paper or scissor?: ") choose1 = input(player1+ " choose rock, paper or scissor?: ") for turn in range(4): print("Turn", turn+1) if choose == "rock" and choose1 =="scissor": print(player+" won") elif choose == "paper" and choose1 =="rock": print(player+ " won") elif choose == "scissor" and choose1 =="paper": print(player+ " won") elif choose1 == "rock" and choose =="scissor": print(player1 +" won") elif choose1 == "paper" and choose == "rock": print(player1 +" won") elif choose1 == "scissor" and choose == "paper": print(player1+" won") #Getting an error of 'list indices must be integers or slices,not str' elif guess_same[choose][choose1]=="rock": print("youve guessed that already") else: print("you need to choose one of the options") #Ending the game after 3 turns if turn == 3: print("Game over") break game() game()