New to programming. How can I write this Rock, Paper, Scissors code better?
Despite of very simple and "verbose" initial implementation it has a bunch of issues:


r_p_s = ['Rock', 'Paper', 'Scissors'] is better defined as constant of immutable values
result is accessed within response() function body as a global variable.Instead, it's better called within the function on demand:

def response():
    result = game()
    ...

instead of arbitrary strings concatenation ... + " vs. " + ..., "Roll: " + "\n" + result - use flexible f-string formatting.
For ex.: print(f"Roll: \n{result}")
the conditions like:

if "Scissors vs. Paper" == result or \
    "Paper vs. Scissors" == result:
    print("\nScissors beats Paper")


are too verbose and hard-coded to be manageable and reliable




Now, when you realize the bad things described above and wonder if there a manageable and advanced approach - take and consider the one below, which is OOP approach representing RPSGame class (as a main class) and powered by enum classes to represent the crucial shapes.
The new implementation itself is pretty descriptive (I hope). Enjoy!

import random
from enum import Enum


class RPSGame:
    class Shape(Enum):
        R = 'Rock'
        P = 'Paper'
        S = 'Scissors'

    # winning outcome bindings
    WIN_OUTCOMES = {
        (Shape.P, Shape.R), (Shape.R, Shape.S), (Shape.S, Shape.P),
    }

    @staticmethod
    def choice():
        shapes = list(RPSGame.Shape)
        return random.choice(shapes), random.choice(shapes)

    def play(self):
        shape1, shape2 = self.choice()
        print(f"Roll: \n{shape1.value} vs {shape2.value}\n")

        if shape1 == shape2:
            print("Draw! Roll again.")
        else:
            # check to swap shapes to get winning output order
            if (shape1, shape2) not in RPSGame.WIN_OUTCOMES:
                shape1, shape2 = shape2, shape1
            print(f"{shape1.value} beats {shape2.value}!")


if __name__ == "__main__":
    rps = RPSGame()
    rps.play()
    rps.play()
    rps.play()


Sample output (from 3 plays):

Roll: 
Paper vs Scissors

Scissors beats Paper!
Roll: 
Scissors vs Scissors

Draw! Roll again.
Roll: 
Rock vs Paper

Paper beats Rock!