2 Player Rock Paper Scissors (Python) I created a &quot;2-player&quot; rock-paper-scissors game in Python mainly using if statements and a single while loop. The program is really simple, but I was wondering if using switch statements or perhaps another format would make it less cluttered/quicker/etc.
again = 'y'

while (again == 'y'):

    p1 = input(&quot;Player 1 --&gt; Rock, Paper, or Scissors? &quot;)
    p1 = p1.lower()

    print()

    p2 = input(&quot;Player 2 --&gt; Rock, Paper, or Scissors? &quot;)
    p2 = p2.lower()

    print()

    if (p1 == &quot;rock&quot;):
        if (p2 == &quot;rock&quot;):
            print(&quot;The game is a draw&quot;)
        elif (p2 == &quot;paper&quot;):
            print(&quot;Player 2 wins!&quot;)
        elif (p2 == &quot;scissors&quot;):
            print(&quot;Player 1 wins!&quot;)
    elif (p1 == &quot;paper&quot;):
        if (p2 == &quot;rock&quot;):
            print(&quot;Player 1 wins!&quot;)
        elif (p2 == &quot;paper&quot;):
            print(&quot;The game is a draw&quot;)
        elif (p2 == &quot;scissors&quot;):
            print(&quot;Player 2 wins!&quot;)
    elif (p1 == &quot;scissors&quot;):
        if (p2 == &quot;rock&quot;):
            print(&quot;Player 2 wins!&quot;)
        elif (p2 == &quot;paper&quot;):
            print(&quot;Player 1 wins!&quot;)
        elif (p2 == &quot;scissors&quot;):
            print(&quot;The game is a draw&quot;)
    else:
        print(&quot;Invalid input, try again&quot;)

    again = input(&quot;Type y to play again, anything else to stop: &quot;)

    print()
Remove Redundant Parenthesis
In this line:
while (again == 'y'):

The parenthesis are unneeded and can (should) be removed.
Use a dict to drive the stacked if/else
Whenever I see a stacked if/else I look to restructure the code using a dict (mapping) instead.
The net results of the if/else structure in your code can be put into a dict like so:
results = {
    &quot;rock&quot;: {
        &quot;rock&quot;: &quot;The game is a draw&quot;,
        &quot;paper&quot;: &quot;Player 2 wins!&quot;,
        &quot;scissors&quot;: &quot;Player 1 wins!&quot;,
    },
    &quot;paper&quot;: {
        &quot;rock&quot;: &quot;Player 1 wins!&quot;,
        &quot;paper&quot;: &quot;The game is a draw&quot;,
        &quot;scissors&quot;: &quot;Player 2 wins!&quot;,
    },
    &quot;scissors&quot;: {
        &quot;rock&quot;: &quot;Player 2 wins!&quot;,
        &quot;paper&quot;: &quot;Player 1 wins!&quot;,
        &quot;scissors&quot;: &quot;The game is a draw&quot;,
    },
}

If the results are mapped this way, then the interactions with the user becomes more clear and
your loop can simply become:
while again == 'y':

    p1 = input(&quot;Player 1 --&gt; Rock, Paper, or Scissors? &quot;).lower()
    print()

    p2 = input(&quot;Player 2 --&gt; Rock, Paper, or Scissors? &quot;).lower()
    print()

    result = results.get(p1, {}).get(p2, &quot;Invalid input, try again&quot;)
    print(result)

    again = input(&quot;Type y to play again, anything else to stop: &quot;)
    print() 

This is an example of separating the UI (User Interface) from the Business Logic.