Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

AcidRa1n

  • 2 years ago

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 "

  • This Question is Open
  1. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

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

  2. AcidRa1n
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    hmm? @TuringTest

  3. estudier
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

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

  4. AcidRa1n
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @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!

  5. AcidRa1n
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @Dumboy

  6. AcidRa1n
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  7. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    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.

  8. AcidRa1n
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

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

  9. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

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

  10. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

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

  11. dsabalete
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Set the name of ALL variables without quotes.

  12. LABurn
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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

  13. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

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

  14. AcidRa1n
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

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

  15. AcidRa1n
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @TuringTest

  16. AcidRa1n
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Anyone using Code Acadamy that can help me?

  17. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

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

  18. Joet99
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  19. waterlubber
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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!

  20. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.....

  21. MikeR
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @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.

  22. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @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.

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

    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.