What am I doing wrong here - %s not working


#1

https://www.codecademy.com/courses/python-beginner-sRXwR/3/4?curriculum_id=4f89dab3d788890003000096#

This is the error message I am getting
File "python", line 6
"and your favorite color is _%s__." _%__ (name, quest, color)
^
SyntaxError: invalid syntax

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)

`


#2

The instructions are


Now it's your turn! We have ___ in the code to show you what you need to change!
Inside the string, replace the three ___ with %s.
After the string but before the three variables, replace the final ___ with a %.
Hit Save & Submit Code.
Answer the questions in the console as they pop up! Type in your answer and hit Enter.


There shouldn't be any underscores in your final answer. It looks like you inserted the %s and % inside of the underscores rather than replacing them.

EDIT: Ugh. I hit my first-day post limit D: I'm glad to help and even gladder that you managed to debug yourself :smiley:


#3

Thank you :). I actually figured that out after the last % had to delete the existing underscore.
then it worked .. I was going to post here that I was able to work the code after I deleted those extra undescores


#4

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