-4
name1 = input("What is your name? \n")
name2 = input("What is their name? \n")

total1 = (name2+name1).count('t') + (name2+name1).count('r') + (name2+name1).count('u') + (name2+name1).count('e')
print("total1", total1)

total2 = (name2+name1).count('l') + (name2+name1).count('o') + (name2+name1).count('v') + (name2+name1).count('e')
print("total2", total2)

if (total1, total2) <= 10 or >= 90:
  print("Your score is", total1,total2, "you go together like coke and mentos.")

RESULT:

Traceback (most recent call last):
  File "/Users/PythonLoveCalculator.py", line 11
    if (total1, total2) <= 10 or >= 90:
                                  ^
SyntaxError: invalid syntax

What’s the simple explanation about this Syntax Error????

buran
  • 13,682
  • 10
  • 36
  • 61

1 Answers1

0

SyntaxError occurs because you use >= without a value before it: More proper would be:

if (total1, total2)<=10 or (total1, total2)>=90:
    ...

But then you will get a TypeError because <= not supported between instances of tuple and `int'

It is not clear what are you trying to compare. Maybe you want to do something like this:

if total1<=10 or total2>=90:
    ...