Python error "Python: can't assign to literal"

+1 vote

I am trying to run very simple code in python. 

I am getting an error on this

a = 2, b =4
Jun 17 in Python by Ramya

1 answer to this question.

+1 vote

The way you're assigning variables is not correct. This way is perfect for java or C but not for python. try something like this:

a, b, = 2, 4


a = 2
b = 4
answered Jun 17 by Priya
thank you very much, I spent a lot of time stuck in this problem.
Glad to help.. Upvote the answer, if it's helped you :)

Related Questions In Python

0 votes
1 answer

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

The following are totally acceptable in python: passing ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,520 points
+1 vote
1 answer

How to print an error in Python?

For Python 2.6 and later and Python ...READ MORE

answered Aug 23, 2018 in Python by Priyaj
• 56,900 points
0 votes
1 answer

Pyplot error "only size-1 arrays can be converted to Python scalars"

You can plot the chart by taking ...READ MORE

answered Jan 28 in Python by Omkar
• 67,620 points
0 votes
1 answer

What to do when I get and error saying python not recognized as internal or external command?

You need to set up the path ...READ MORE

answered May 28 in Python by Fata
• 1,040 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 275 views
+4 votes
6 answers
0 votes
1 answer

Python error "TypeError: Can't convert 'int' object to str implicitly"

Hey Yamini, you cannot concatenate a string ...READ MORE

answered May 31 in Python by Gargi
0 votes
1 answer

Python error "error: Unable to find vcvarsall.bat"

Try specifying mingw as the compiler of choice. ...READ MORE

answered May 29 in Python by Imran