Rock Paper Scissor Python
Question: I'm Learning Python and coded rock, paper and scissor game.

I'm using IDLE in Ubuntu for this. The code has compiled fine but still i'm
unable to get this running. IDLE is running fine in this system. PLease help
me resolve this.

Thanks in advance

    
    
    #!/usr/bin/env python2
    import time
    import random
    
    rock = 1
    paper = 2
    scissors = 3
    
    names = {rock:"rock", paper:"Paper",scissors: "Scissors"}
    rules = {rock: scissors, paper: rock,scissors: paper}
    
    player_score = 0
    computer_score = 0
    
    
    
    def start():
        print "Start"
        while game():
         pass
        scores()
    
    def game():
        player = move()
        computer = random.randint(1,3)
        result(player,computer)
        return play_again()
    def move():
        while True:
            print
            player = raw_input("Rock = 1 paper = 2 scissor = 3")
            try:
                player = int(player)
                if player in (1,2,3):
                    return player
            except ValueError:
                    pass
            print "Enter number"
    
    def result(player,computer):
        print "Computer threw {0}!".format(names[computer])
        if player == computer:
         print ("Tie")
        else:
         if rules(player) == computer:
            print("You win")
            player_score += 1
    
         else:
            print("Computer wins")
            computer_score += 1
    def play_again():
        answer = raw_input("Play Again")
        if answer in ("y" "Y"):
          return answer
        else:
            print ("Thanks")
    
    def scores():
        global player_score, computer_score
        print "Player", player_score
        print "Computer", computer_score
    
        start()
    


Answer: Dedent the last line, `start()`. The interpreter runs the upper level of the
script, but the indentation makes that line part of the function `score()`.

