[Solved] Invalid Syntax. No area highlighted [closed]


You have several syntax errors. The first one is here on line 33

elif playmindset == "d":
    playtemp = random.choice([1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,])
playruns = playtemp
playscore = playscore + playruns
print("You scored" ,playruns, "runs.", team, "is on", playscore," runs.")
elif playruns == 5: # this line
    print("Your player is out! ", team,"'s current score is:", playscore,"runs")
    playouts = playouts + 1

That second elif raises a syntax error because there is no if that precedes it. Perhaps you meant to place the 3 lines in between the 2 elifs in the first one, or maybe make the second elif a new if. That is for you to fix.

Furhermore syntax errors are raised because you print stuff like this at several places in your program (lines 52, 66, 84, 120, 122)

print("The Androidz score was:", compscore.)

the . behind compscore insinuates you are going to call a function on it, or a property or something. Because you do not do that it raises a syntax error. I think you just want to print a dot at the end of the line, in that case just change them to

print("The Androidz score was:", compscore + ".")

1

solved Invalid Syntax. No area highlighted [closed]