0
 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?

asked Dec 18, 2019 at 0:42
1
  • If you wish to do some more research into operators, you can read up here. https://data-flair.training/blogs/python-operator/ Commented Dec 18, 2019 at 0:48

2 Answers 2

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
Sign up to request clarification or add additional context in comments.

Comments

1

The inequality syntax is wrong, it should be != rather than =!

answered Dec 18, 2019 at 0:47

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.