Help- How generate/store data for later analysis from the python program

I am trying to follow this article https://www.dataquest.io/blog/basic-statistics-in-python-probability/ and want to generate my own data from the program I wrote.

#Pseudocode
""" Get initial Wins, Losses Ties
 Assign the value of Rock,Paper and Scissor 
 Give option to quit
 Let user give the input 
 Generate Rock Paper Scissor for opponent 
 Compare the input with the given variable and let user know if he won, lost or it tied
 Keep the counter for win,loss or ties
 End the program if player chooses to quit"""


import random,sys

print('ROCK, PAPER, SCISSORS')
print('0 Wins, 0 Losses, 0 Ties')
win=0
loss=0
tie=0

while True:
    print('Enter your move: (r)ock (p)aper (s)cissors or (q)uit')
    userinput=input()
    if userinput=='r' or userinput=='s' or userinput=='p' or userinput=='q':
        if userinput=='q':
            print('Do you really want to quit? y/n')
            quitinput=input()
            if quitinput=='n':
                print('Good Choice! The game will continue')
            elif quitinput=='y':
                print('See you later!')
                sys.exit()

        if userinput=='r':
            print('ROCK VERSUS')
        elif userinput=='p':
            print('PAPER VERSUS')
        elif userinput=='s':
            print('SCISSOR VERSUS')
    else: 
        print('Please only provide the following values: r,p,c,q ')
        break

    pcinputnum=random.randint(1,3)
    pcinputvalue=''
    if pcinputnum==1:
        pcinputvalue='r'
        print('ROCK')
    elif pcinputnum==2:
        pcinputvalue='p'
        print('PAPER')    
    elif pcinputnum==3:
        pcinputvalue='s'
        print('SCISSOR')
    if userinput== pcinputvalue:
        print('It is a Tie')
        tie+=1
    elif userinput=='r' and pcinputvalue=='s':
        print('You win')
        win+=1
    elif userinput=='r' and pcinputvalue=='p':
        print('You lose')
        loss+=1
    elif userinput=='p'and pcinputvalue=='s':
        print('You lose')
        loss+=1
    elif userinput=='p' and pcinputvalue=='r':
        print('You win')
        win+=1    
    elif userinput=='s'and pcinputvalue=='p':
        print('You win')
        win+=1
    elif userinput=='s' and pcinputvalue=='r':
        print('You lose')
        loss+=1
    print(str(win)+' Wins, '+str(loss)+ ' Losses, '+str(tie)+' Ties')

I want to generate the data from this program. Then I want to do analysis on this data. Basically I want to find the probability of winning in the rock paper scissor for each of the selection(Rock,Paper/Scissor) out of 100 games or something like that.

SAMPLE OUTPUT OF THE PROGRAM:

Enter your move: (r)ock (p)aper (s)cissors or (q)uit
r
ROCK VERSUS
SCISSOR
You win
4 Wins, 1 Losses, 1 Ties

Any help would be appreciated.

Hi, I think that a pretty simple way to do this without changing the program would be (my pseudocode):

  1. create a list [“r”, “p”, “s”]
  2. import the random module and use random.choice from that list- set this to a variable
  3. use this variable instead of the user input
  4. set up a while loop with a counter to run the program until the counter reaches 100

Let me know if any of these steps don’t make sense. I wasn’t sure if you were asking to run the program 100 times, or to export the result to a file- so let me know if I answered the wrong question :-).