My rock paper scissors AI script isn’t working

So Basically I’ve been making an AI Rock Paper Scissors script with python and it works, but only chooses Paper and I need it to choose the different things. The problem lies in between line 29 and 46. There is probably a simple fix but I cannot seem to find it. Please help me with my noobie coding.

import random
import numpy as np
import matplotlib.pyplot as plt

x = 1

paper = 0
rock = 0
scissors = 0

plist = []

result = ""
def percentage(item, result):
    total = rock + paper + scissors
    result = item / total * 10
while x == 1:

    print(" ")
    ui = input("Rock, Paper, Scissors: ")
    if ui == "Rock":
        rock += 1
    elif ui == "Paper":
        paper += 1
    elif ui == "Scissors":
        scissors += 1



    plist.append(ui)

    plist = ["Rock", "Scissors", "Rock", "Rock", "Paper"]

    if plist[0] == "Rock":
        aio = "Paper"
        plist.pop(0)
    elif plist[0] == "Paper":
        aio = "Scissors"
        plist.pop(0)
    elif plist[0] == "Scissors":
        aio = "Rock"
        plist.pop(0)

    print(" ")
    print("AI chose " + aio)
    print(" ")
    if aio == "Rock" and ui == "Paper":
        print("You won")
    elif aio == "Paper" and ui == "Scissors":
        print("You won")
    elif aio == "Scissors" and ui == "Rock":
        print("You won")
    elif aio == "Paper" and ui == "Rock":
        print("You lost")
    elif aio == "Scissors" and ui == "Paper":
        print("You lost")
    elif aio == "Rock" and ui == "Scissors":
        print("You lost")
    elif aio == "Paper" and ui == "Paper":
        print("You tied")
    elif aio == "Scissors" and ui == "Scissors":
        print("You tied")
    elif aio == "Rock" and ui == "Rock":
        print("You tied")

Answer

It’s not clear what exactly your AI is supposed to be doing, but right now it’s always picking Paper because in each loop you always do this:

    plist = ["Rock", "Scissors", "Rock", "Rock", "Paper"]

    if plist[0] == "Rock":
        aio = "Paper"

There’s no way for plist[0] to ever be anything other than Rock with this code — regardless of what you’d previously assigned to it, you’re re-assigning it to this static list every time before you do your comparison (and it doesn’t matter that you pop from it and append to it since you’ll overwrite the whole thing before the next time you look at it). Since it’s not clear what the purpose of plist is, I’d suggest just getting rid of it and using random.choice to pick the AI’s throw:

import random

while True:
    ui = input("nRock, Paper, Scissors: ")
    aio = random.choice(["Rock, Paper, Scissors"])

    print(f"nAI chose {aio}n")
    if aio == "Rock" and ui == "Paper":
        print("You won")
    elif aio == "Paper" and ui == "Scissors":
        print("You won")
    elif aio == "Scissors" and ui == "Rock":
        print("You won")
    elif aio == "Paper" and ui == "Rock":
        print("You lost")
    elif aio == "Scissors" and ui == "Paper":
        print("You lost")
    elif aio == "Rock" and ui == "Scissors":
        print("You lost")
    elif aio == "Paper" and ui == "Paper":
        print("You tied")
    elif aio == "Scissors" and ui == "Scissors":
        print("You tied")
    elif aio == "Rock" and ui == "Rock":
        print("You tied")
    else:
        print(f"You picked {ui}, which was not one of the choices.")