I am writing a python code and I am trying to figure out which function would be the best to carry out the following task:
I want to say "if the number of words in a line isn't equal to 1, do stuff"
#Some code
words = line.split("\t")
if sum(words) != 1
#Do something
#Some code
words = line.split("\t")
if int(words) != 1
#Do something
#Some code
words = line.split("\t")
if len(words) != 1
#Do something
All of these commands return the following error:
File "test.py", line 10
if len(words) != 1
^
SyntaxError: invalid syntax
Can anyone help?