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?
2 Answers 2
=! is not a valid operator You need to update =! to !=
test = 1
test1 = 2
test =! test1
SyntaxError: invalid syntax
test != test1
True
answered Dec 18, 2019 at 0:47
PacketLoss
5,7661 gold badge12 silver badges29 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
The inequality syntax is wrong, it should be != rather than =!
answered Dec 18, 2019 at 0:47
William Herewini
1992 silver badges17 bronze badges
Comments
lang-py
https://data-flair.training/blogs/python-operator/