#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    WHY CAN'T I USE " IN PYTHON???


    >:-( I type this string of code into GUI and it says that the highlighted bit is syntax error??????
    help me please

    name=input("what is the hero's name? > ")
    "name"
    "name comes to a door, does he: A)walk away B)see if it is unlocked C)smash it open"
    if choice==a "woose"
    if choice==b "it is locked, better luck next time!"
    if choice==c "it is torn off its hinges! But there are zombies here"
    "what does he do?"
    choice2=input("A)run away, B)fight for his life or C)wait and call for help > ")
    if choice2==a "woose"
    if choice2==b "he died courageously"
    if choice2==c "three soldiers arive, he helps them destroy the zombies"
    "continuing down a long tunnel, he notices water coming in through the walls. Suddenly it starts to flood and there is a door at the end"
    choice3=input("does he : A)wait until it stops, B)go for the door or C)try to float > ")
    if choice3==a "he drowned"
    if choice3==b "the door is locked, he drowned"
    if choice3==c "he survives, but only two soldiers remain"
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,854
    Rep Power
    481
    if choice==a: "woose"


    You need a colon, the problem is not about double quote.

    Your code has many problems. Nothing but misunderstanding, really. Please return to the python tutorial and practice with extremely simple statements in the interpreter. Your posting style is incomprehensible. Please use code tags as shown in my signature.

    Finally---oh yes, there's more---we need to know the version of python you're using for this program.
    Last edited by b49P23TIvg; May 29th, 2013 at 12:30 PM.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    610
    Rep Power
    65
    Interesting syntax, but unfortunately not Python syntax.
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    Tewksbury, MA
    Posts
    37
    Rep Power
    2
    I suggest you put your idea for a text adventure on hold until you're more experienced. They are fun to play with but without OOP (classes) you'll soon be swamped in unreadable, undebuggable code. The worst part is that you'll spend most of your time trying to think of cool storylines and plots and never learn how to program.

    Stick with the basics.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0
    thank you, it really helped
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Location
    Usually Japan when not on contract
    Posts
    240
    Rep Power
    12
    Originally Posted by Marbelous
    I suggest you put your idea for a text adventure on hold until you're more experienced. They are fun to play with but without OOP (classes) you'll soon be swamped in unreadable, undebuggable code. The worst part is that you'll spend most of your time trying to think of cool storylines and plots and never learn how to program.

    Stick with the basics.
    Because without pretending that all functions should be subordinate to data structures writing text adventures is so hard...

    Good thing MUDs aren't written in C or anything... that would just be crazy. (>.<)

    It would perhaps provide the noob more insight to explain that data and process should be separate, and that either a concept of state can be passed along continuation pipelines to avoid creating global spaghetti conditions (where he's headed) or that common state can be blessed into existence in other ways (structs or classes). But just pretending that OOP magically makes all complexity issues go away is a disservice.
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    Tewksbury, MA
    Posts
    37
    Rep Power
    2
    Originally Posted by zxq9
    Because without pretending that all functions should be subordinate to data structures writing text adventures is so hard...

    Good thing MUDs aren't written in C or anything... that would just be crazy. (>.<)

    It would perhaps provide the noob more insight to explain that data and process should be separate, and that either a concept of state can be passed along continuation pipelines to avoid creating global spaghetti conditions (where he's headed) or that common state can be blessed into existence in other ways (structs or classes). But just pretending that OOP magically makes all complexity issues go away is a disservice.
    Umm, sure, whatever you say. No doubt all the "noobs" will appreciate your... .. making that clear?

IMN logo majestic logo threadwatch logo seochat tools logo