Reputation: 17
for i in range(len(nestedlist)):
if nestedlist[i][-1]=!0:
print(str(nestedlist)[i][0])+" "+str(nestedlist)[i][-1]))
This code works, the if is the thing that ruins this can some one help?
Upvotes: 0
Views: 32
Reputation: 5746
=!
is not a valid operator You need to update =!
to !=
test = 1
test1 = 2
test =! test1
SyntaxError: invalid syntax
test != test1
True
Upvotes: 2
Reputation: 199
The inequality syntax is wrong, it should be !=
rather than =!
Upvotes: 1