Hi! ; despite writing the code properly , the error still exist , i can’t neither write the answers nor get to the next lesson , any help ?


Can you try to post your code here? We can’t see what your code is by clicking the link


name = raw_input(“What is your name?”)
quest = raw_input(“What is your quest?”)
color = raw_input(“What is your favorite color?”)

print "Ah, so your name is %s, your quest is %s, "
“and your favorite color is %s.” % (name, quest, color)


The problem is a bit silly and I’m not sure if it was already explained in the course this far, but your print statement is acting up. You are missing the continuation mark \ (the backslash). It should go in between both lines of string.
Like this

"Ah, so your name is %s, your quest is %s, "
“and your favorite color is %s.”

Because otherwise Python thinks these are 2 separate strings and will apply the string substitution to them separately and therefore fail. The backslash will tell Python it’s one string of text. A other solution to this problem is putting all of the text within single quotation marks “” like this but without the \ backslash:

“Ah, so your name is %s, your quest is %s, and your favorite color is %s.”

Hope this is helpful.


Be sure to enter something at each prompt (three inputs, in all), else the program will be waiting and will eventually timeout. Make sure to enter something, not just hit Enter.


What is your name?What is your quest?What is your favorite color?Ah, so your name is SCT, your quest is if type(error) == ValueError:, and your favorite color is return "Make sure to use a lowercase “s” with %s. Python told us about the following error: " + str(error).
the same prb again can u try to write it here pls
i’m thinkin’ that the prb is from the website itself


can u give me an example ?


I tried just hitting enter without any input and it still worked. It is probably something with his code that is causing the traceback

name = raw_input("What is your name?")
quest = raw_input("What is your quest?")
color = raw_input("What is your favorite color?")

print "Ah, so your name is %s, your quest is %s, " \
"and your favorite color is %s." % (name, quest, color)

This is my code that works. Don’t just copy paste it, but look at it and compare it to the code you have in your screen. If you see any difference change your code and run it and see if it works. If you spot a difference please let me know what it was. Remember to look very closely it can be in the details


i coppied ur code ; past it there ; and yet , it doesn’t work , when i write my code on another online console it does , i really don’t know why


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.