-3

so I was writing some code for a rock paper scissor game in python and it just doesn't work even though it shows that it has zero errors. I have the latest python interpreter and the latest version of python installed. Any help?

    import random

def play():
    user = input(" r for rock , s for scissors , p for paper==  ")
    computer = random.choice()
    if user == computer:
        return "tie"
    if is_win(user,computer):
        return "you won!"
    
    return "you lost!"



def is_win(player , opponent):
    if  player == 'r' and opponent == 's':
        print("player wins!")
    elif player == 's' and opponent == 'p':
        print("player wins!")
    elif player == 'p' and opponent == 'r':
        print("player wins!")
    elif player == 's' and opponent == 'r':
        print("opponent wins!")
    elif player == 'p' and opponent == 's':
        print("opponent wins!")
    elif player == 'r' and opponent == 'p':
        print("opponent wins!")

play()
JamJ
  • 1
  • 1

0 Answers0