import random print "Welcome to Rock, Paper, Scissors!" print wins = int(raw_input("How many points are required for a win? ")) print human_wins, comp_wins = 0, 0 while human_wins != wins and comp_wins != wins: human_choice = raw_input("Choose (r)ock, (p)aper, or (s)cissors. ") comp_choice = random.choice('rps') human_choice = human_choice.lower() r = 'rock' p = 'paper' s = 'scissors' if human_choice == comp_choice: if human_choice == 'r': print "Human: " + r + "\tComputer: " + r print "\tIt's a draw." elif human_choice == 'p': print "Human: " + p + "\tComputer: " + p print "\tIt's a draw." else: print "Human: " + s + "\tComputer: " + s print "\tIt's a draw." elif human_choice == 'r' and comp_choice == 's': print "Human: " + r + "\tComputer: " + s print "\tHuman wins!" human_wins += 1 elif human_choice == 'p' and comp_choice == 'r': print "Human: " + p + "\tComputer: " + r print "\tHuman wins!\n" human_wins += 1 elif human_choice == 's' and comp_choice == 'p': print "Human: " + s + "\tComputer: " + p print "\tHuman wins!" human_wins += 1 elif comp_choice == 'r' and human_choice == 's': print "Human: " + s + "\tComputer: " + r print "\tComputer wins!" comp_wins += 1 elif comp_choice == 'p' and human_choice == 'r': print "Human: " + r + "\tComputer: " + p print "\tComputer wins!" comp_wins += 1 elif comp_choice == 's' and human_choice == 'p': print "Human: " + p + "\tComputer: " + s print "\tComputer wins!" comp_wins += 1 print "Score: Human " + str(human_wins) + "\tComputer " + str(comp_wins) + "\n" print "Final Score: Human " + str(human_wins) + "\tComputer " + str(comp_wins) if human_wins > comp_wins: print "The human wins the round!" else: print "The computer wins the round!"