Python error "Python: can't assign to literal"
I am trying to run this code in python.
and getting syntax errors.
a = 2, b =4
But I am getting an error that says”python can't assign to literal”:
SyntaxError: can't assign to literal
How can I resolve this?
This is a simple syntax error. In python you cannot assign values to variables like this. I think the syntax you are looking for is this:
a, b = 2, 4
Or you can also do it like this:
a = 2
b = 4