SyntaxError in if/elif block
Question: So I tried making a basic Rock Paper Scissors game with Python 3 and random
AI.

    
    
    import random
    x=0
    InvalidInput="Invalid Input, please use a capital letter at the start of your input"
    while x==0:
        AI=random.randint(1,3)
        UserInput=input("Rock, Paper, or Scissors?")
        if AI==1:
            AI="Rock"
        elif AI==2:
            AI="Paper"
        elif AI==3:
            AI="Scissors"
        print("You chose {}, Computer chose {}".format(UserInput, AI)
    
        #Quit
        elif UserInput=="Quit":
            break
        #Tie
        elif AI==UserInput:
            print("Its a tie!")
    
        #AI chooses Rock
        elif AI=="Rock":
            if UserInput=="Paper":
                print("You Win!")
            elif UserInput=="Scissors":
                print("You Lose")
            else:
                print(InvalidInput)
        #AI chooses Paper
        elif AI=="Paper":
            if UserInput=="Scissors":
                print("You Win!")
            elif UserInput=="Rock":
                print("You Lose")
            else:
                print(InvalidInput)
    
        #AI chooses Scissors
        elif AI=="Scissors":
            if UserInput=="Rock":
                print("You Win!")
            elif UserInput=="Paper":
                print("You Lose")
            else:
                print(InvalidInput)
    

now I that is the bug:

> Traceback (most recent call last): File "python", line 16 elif
> UserInput=="Quit": ^ SyntaxError: invalid syntax


Answer: Made some changes, indented the print, also wrote closing bracket for print,
moved Quit to a separate if and added check for Capital letters in Rock,
Paper, Scissors and Quit.

    
    
    import random
    x=0
    InvalidInput="Invalid Input, please use a capital letter at the start of your input"
    while x==0:
        AI=random.randint(1,3)
        if AI==1:
            AI="Rock"
        elif AI==2:
            AI="Paper"
        elif AI==3:
            AI="Scissors"
    
        UserInput=input("Rock, Paper, or Scissors?")
        if UserInput[0] not in 'RPSQ':
            print(InvalidInput)
            continue
        else:
            #Quit
            if UserInput=="Quit":
                break
            print("You chose {}, Computer chose {}".format(UserInput, AI))
            #Tie
            if AI==UserInput:
                print("Its a tie!")
    
            #AI chooses Rock
            elif AI=="Rock":
                if UserInput=="Paper":
                    print("You Win!")
                elif UserInput=="Scissors":
                    print("You Lose")
                else:
                    print(InvalidInput)
            #AI chooses Paper
            elif AI=="Paper":
                if UserInput=="Scissors":
                    print("You Win!")
                elif UserInput=="Rock":
                    print("You Lose")
                else:
                    print(InvalidInput)
    
            #AI chooses Scissors
            elif AI=="Scissors":
                if UserInput=="Rock":
                    print("You Win!")
                elif UserInput=="Paper":
                    print("You Lose")
                else:
                    print(InvalidInput)
    

