Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 16 Online
OpenStudy (anonymous):

File "python", line 2 SyntaxError: can't assign to literal Oops, try again. Make sure that you define the variable 'my_int'. #Set the variables to the values listed in the instructions! "my_int" = 7 "my_float" = 1.23 "my_bool" = True Dafaq am I doing wrong? I even tried "my_bool" without "

OpenStudy (turingtest):

You can't assign a string as a passive parameter like that. Just make it not a string.

OpenStudy (anonymous):

hmm? @TuringTest

OpenStudy (anonymous):

"my_int" = 7 s/b my_int = 7 Other 2, the same.

OpenStudy (anonymous):

@estudier I did that, it wont work.. I have alot of back knowledge on Python and other languages.. I cant seem to figure out why this is not working!

OpenStudy (anonymous):

@Dumboy

OpenStudy (anonymous):

I have to go but can you try to find out what's wrong. It's section one, can you do me a favor, go back and see what you wrote. I'll check here when I get back.

OpenStudy (turingtest):

there is no doubt that if you put my_int = 7 my_float = 1.23 my_bool = True #then print it out print my_int, my_float, my_bool you will see that it binds those values to those variables the only thing I can suggest is that you recheck your numbers, otherwise you are missing information, or the test is wrong.

OpenStudy (anonymous):

omg @TuringTest NOTHING WILL WORK LMAO Can you go to the '' data types '' mini section to see if it will work? on Academy

OpenStudy (turingtest):

is this code academy? I'm not in code academy

OpenStudy (turingtest):

here's the proof it works though http://www.codeskulptor.org/#user2-4bPHjgeQcHUabIT-0.py

OpenStudy (anonymous):

Set the name of ALL variables without quotes.

OpenStudy (anonymous):

You should make sure that your variables do not have quotes around them, as it is a string. You cannot assign strings values, just like you cannot assign integers and floats values. my_int= 7 my_float= 1.23 my_bool= True

OpenStudy (turingtest):

...and now everyone is repeating themselves. Click the link that I posted and run the program, you can see it works!

OpenStudy (anonymous):

haha yeah I know it works. Python isn't that sensitive I think this is code academy possibly.

OpenStudy (anonymous):

@TuringTest

OpenStudy (anonymous):

Anyone using Code Acadamy that can help me?

OpenStudy (turingtest):

It must be, so I guess I'm out since I'm not using Code Academy good luck!

OpenStudy (anonymous):

From past experience with Code Academy, be prepared for unexpected responses to unexpected input. This can vary from exercise to exercise, based on randomness introduced in their inline interpreter. If it works in your Python setup but not Code Academy, find a way to move past it.

OpenStudy (anonymous):

You made a simple but common mistake: #Set the variables to the values listed in the instructions! "my_int" = 7 "my_float" = 1.23 "my_bool" = True Those quotes " " messed it up. Python thinks its a string! Simple change your code to this, and Monty Python will like you! :) my_int = 7 my_float = 1.23 my_bool = True Good Luck!

OpenStudy (microbot):

hahaha im sry but just had to comment it....: ppl do not know how to read rly-.-.....you have been all repeating the same thing that @TuringTest said and that @AcidRaln already said it wont work ....seriously learn to read before posting.....

OpenStudy (anonymous):

@Microbot: If it works for everybody else (me too -- I tried) there is possibly something wrong with your setup. Please post OS & Version, Python version, IDLE version.

OpenStudy (microbot):

@miker i think u missread what I wrote.what I said is that everyone keep saying its the double quotes...that turing already said.means ppl do not read previous answers.and I just added that acid already even gave him a response on that,by saying it wouldn't work for him.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!