I am a beginner in programming and this is the third program I've written. This is an interactive game of rock, paper, scissors, capable of being modified to any number of turns. I would love to see how a more experienced programmer could simplify this and make it smaller. Please let me know how I could change this program to be easier to understand for other programmers or any general layout/design rules I should keep in mind when writing future programs. I just have the slightest feeling that this code could be more compact.
args = ['rock', 'paper', 'scissors'] user_score = 0 comp_score = 0 turn = 3 print 'ROCK, PAPER, SCISSORS!' print 'Best out of %d' % (turn) while turn > 0: user = raw_input('Choose ' + ", ".join(args) + ' > ') comp = random.choice(args) proof = 'Computer: %s' % (comp) if user == 'q': break elif (user == args and comp == args) or (user == args\ and comp == args) or (user == args and comp == args): print proof print 'Win \n' turn -= 1 user_score += 1 elif user == comp: print proof print 'Tie \n' turn -= 1 elif user not in args: print 'INVALID INPUT \n' else: print proof print 'Lose \n' turn -= 1 comp_score += 1 print '\n User scored: %d \n Computer scored: %d \n' % (user_score,comp_score) if user_score > comp_score: print 'Winner!' elif user_score < comp_score: print 'Loser' else: print 'Draw'