15 String Formatting with %, Part 2


#1


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

Oops, try again.
Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: name 's' is not defined

it's not taking the color name plz help

Replace this line with your code. Do not remove the backticks that are above or below this line.
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

Try reseting the code, and trying again, because there is nothing wrong with that code, and it works for me.


#3

Doesn't work for me neather...


#4

@boynamedniki As I said before, "Try resetting the code and trying again, because there is nothing wrong with that code."


#5

I now now what whent Wrong: didn't erase the underscore...


#6

i reset the code like 6 times already and i get this
Traceback (most recent call last):
File "python", line 6, in
TypeError: unsupported operand type(s) for &: 'str' and 'tuple'


#8

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 ___, your quest is ___, " \
"and your favorite color is ___." %s (name, quest, color)


#9

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)

god luck.


#10

when it says the first thing in the consel like your name you must type your name then repeat with the next 2 things it prints in the consle


#11

what does raw_input denote here?


#12

#13

This topic is old and now closed, if you still have questions make a new topic with your question. Use the template to make it a good topic