0 votes
1 view
in Python by (14.3k points)

I am trying to run very simple code in python. 

I am getting an error on this

a = 2, b =4

But I am getting an error that says:

SyntaxError: can't assign to literal

How can i resolve this?

1 Answer

0 votes
by (25.1k points)

This is mainly due to a simple syntax error. You cannot assign values to python 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

To learn more about Python in depth you can watch this video on YouTube:

Welcome to Intellipaat Community. Get your technical queries answered by top developers !