Problems with Rock, Paper, Scissors Python Code
<p>I'm working on a code with <code>python</code>, where we've been asked to create a game of Rock, Paper, Scissors using an external file of options (rock, paper, scissors) as opposed to having the code use any user input. However, for some reason, my code doesn't work. When someone inputs "yes", it prints "Let us play now,"  but that's it. Nothing else happens.</p>

<p>Why isn't the game completing when a user provides "yes" as input?</p>

<pre><code>from random import randrange
def sample():
    computer_input = randrange(1,3)
    return computer_input

def main():
    a = [] 
    infile = open("input2.txt", "r")
    for line in infile:
        a.append(line)
    computer_input = sample()

    tied = 0 #games tied
    user_won = 0 #games won by user
    comp_won = 0 #games won by computer

    user_input = ""
    computer_input = ""

    print("Rules of the game...")
    print("Would you like to turn up with a game of rock, paper, or scissors? ;) Yes or no? --&gt;")
    answer = input()
    if (answer == "yes"):
        play = True
        print("Let us now play.")

##    elif(answer == "no" or "No"):
##        play = False
##        print("Sorry. Maybe we can play next time ;)")
##    else:
##        play = False
##        print("Please try again!")
##        main()

    while True:
        if(computer_input == "1"):
            if(user_input == a[0]):
                tied = tied + 1 
                print("Game is tied!")        
            elif(user_input == a[1]):
                user_won = user_won + 1
                print("You won! Paper covers Rock")        
            elif(user_input == a[2]):
                comp_won = comp_won + 1
                print("You lost! Rocks knocks out scissors")       
##            else:
##                print("Try again!")    
        elif (computer_input == "2"):
            if (user_input == a[0]):
                comp_won = comp_won + 1
                print("You lost! Paper covers Rock")
            elif(user_input == a[1]):
                tied = tied + 1 
                print("Game is tied!")
            elif(user_input == a[2]):
                user_won = user_won + 1
                print("You won! Scissors cuts Paper")
##            else:
##                print("Try again!")       
        else :
            if(user_input == a[0]):
                user_won = user_won + 1
                print("You won! Rock knocks out scissors")
            elif(user_input == a[1]):
                comp_won = comp_won + 1
                print("You lost! Scissors cuts Paper")
            elif(user_input == a[2]):
                tied = tied + 1 
                print("Game is tied!")
##            else:
##                print("Try again!")
##                


##print("Game over")
##print("Statistics")
##print("Games tied --&gt;", tied)
##print("Game won by comp --&gt;", comp_won)
##print("Game won by user --&gt;", user_won)
##        

main()
</code></pre>