anonymous
  • anonymous
What does 'can't assign to literal' error mean? I did: '3 + 3' = 'six' print ('3 + 3') It gives me that error. I intended to get 'six' printed out, since I intended to assign 'six' to '3 + 3'
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
you cannot assign a string to another string '3+3' is an illegal name because there's numbers and operators only
ParthKohli
  • ParthKohli
``` var x = "y" ``` The above is the standard format for assignment.
ParthKohli
  • ParthKohli
Note that it is not this: ``` var "x" = "y" ```

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

MicroBot
  • MicroBot
on the left side u have to have a variable name to assign to a string ,a number,or an other variable that has to be on the right side. so if u wanted to call your variable something like 3+3 it cant be a string ,and u cant start the variable name with a number or have an operator in it. Instead you could call it threeplusthree or threeplus3. so: threeplus3='six' should do it. :) Check this for further info: (1.6.1. Literals and Identifiers) http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/variables.html
anonymous
  • anonymous
you are trying to assign a value to another value you can only assign a value to a variable

Looking for something else?

Not the answer you are looking for? Search for more explanations.