My Problem(s): The problem now is that whenever I enter a number of times to play, it just ignores it and plays forever. It is also not updating the score even though I have global variables and I am adding to them every time there is a win or loss.
 Also, I do not want to ask the player(s) for their names every time they play (only when using the "out of a certain number of points function of the game). Any suggestions/help would be greatly appreciated!
Also, I do not want to ask the player(s) for their names every time they play (only when using the "out of a certain number of points function of the game). Any suggestions/help would be greatly appreciated!
My code is below for reference:
from random import randint
import sys
print("Lets play a game!")
dotheywantotplay = input("Do you want to play Rock-Paper-Scissors? (y or n) ")
bestOutOf = int(input("Best out of: (Enter a number 1-10) "))
player1score = 0
player2score = 0
computerscore = 0
class PlayWithFriend:
    def __init__(self, player1, player2, name1, name2, player1score, player2score):
        self.player1 = player1
        self.player2 = player2
        self.name1 = name1
        self.name2 = name2
        self.player1score = player1score
        self.player2score = player2score
        if player1 == player2:
                print("Tie!")
        elif player1 == "Rock":
            if player2 == "Paper":
                print("You Win", name2,"!")
                print(player2, "covers", player1)
                player2score += 1
                print("The score is -->  %d: %s vs %d: %s" %(player1score, name1, player2score, name2))
            else:
                print("You Win", name1,"!")
                print(player1, "smashes", player2)
                player1score += 1
                print("The score is -->  %d: %s vs %d: %s" %(player1score, name1, player2score, name2))
        elif player1 == "Paper":
            if player2 == "Scissors":
                print("You Win", name2,"!")
                print(player2, "cut", player1)
                player2score += 1
                print("The score is -->  %d: %s vs %d: %s" %(player1score, name1, player2score, name2))
            else:
                print("You Win", name1,"!")
                print(player1, "covers", player2)
                player1score += 1
                print("The score is -->  %d: %s vs %d: %s" %(player1score, name1, player2score, name2))
        elif player1 == "Scissors":
            if player2 == "Rock":
                print("You Win", name2,"!")
                print(player2, "smashes", player1)
                player2score += 1
                print("The score is -->  %d: %s vs %d: %s" %(player1score, name1, player2score, name2))
            else:
                print("You Win", name1,"!")
                print(player1, "cut", player2)
                player1score += 1
                print("The score is -->  %d: %s vs %d: %s" %(player1score, name1, player2score, name2))
        else:
            print("That's not a valid play. Check your spelling!")
class PlayWithComputer:
    def __init__(self, player, name, player1score, computerscore):
        self.player = player
        self.player1score = player1score
        self.computerscore = computerscore
        self.name = name
        t = ["Rock", "Paper", "Scissors"]
        computer = t[randint(0,2)]
        if player == computer:
            print("Tie!")
            print("The score is -->  %d: %s vs %d: computer" %(player1score, name, player2score))
        elif player == "Rock":
            if computer == "Paper":
                print("You lose!", computer, "covers", player)
                computerscore += 1
                print("The score is -->  %d: %s vs %d: computer" %(player1score, name, player2score))
            else:
                print("You win!", player, "smashes", computer)
                player1score += 1
                print("The score is -->  %d: %s vs %d: computer" %(player1score, name, player2score))
        elif player == "Paper":
            if computer == "Scissors":
                print("You lose!", computer, "cut", player)
                computerscore += 1
                print("The score is -->  %d: %s vs %d: computer" %(player1score, name, player2score))
            else:
                print("You win!", player, "covers", computer)
                player1score += 1
                print("The score is -->  %d: %s vs %d: computer" %(player1score, name, player2score))
        elif player == "Scissors":
            if computer == "Rock":
                print("You lose...", computer, "smashes", player)
                computerscore += 1
                print("The score is -->  %d: %s vs %d: computer" %(player1score, name, player2score))
            else:
                print("You win!", player, "cut", computer)
                player1score += 1
                print("The score is -->  %d: %s vs %d: computer" %(player1score, name, player2score))
        else:
            print("That's not a valid play. Check your spelling!")
if dotheywantotplay == "y":
    PlayWith = input("Do you want to play Rock-Paper-Scissors with computer or a friend? (computer, friend, exit) ")
    while  PlayWith in ('computer', 'friend', 'exit'):
        if PlayWith == "friend":
            player1 = input('Enter first players name: ')
            player2 = input('Enter second players name: ')
            while player1score + player2score < bestOutOf:
                personchoice1 = input("First player... Rock, Paper or Scissors?  ")
                personchoice2 = input("Second player... Rock, Paper or Scissors?  ")
                PlayWithFriend(personchoice1, personchoice2, player1, player2, player1score, player2score)
        elif PlayWith == "computer":
            player = input('Enter first players name: ')
            while player1score + computerscore < bestOutOf:
                personchoice = input("Rock, Paper, Scissors?  ")
                PlayWithComputer(personchoice, player,  player1score, computerscore)
        elif PlayWith == "exit":
            sys.exit()
        else:
            print("That's not a valid play. Check your spelling!")
else:
    print("I am sad now :-(")
    sys.exit()
 
     
     
    