String Formatting with %, Part 2


This is my code
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)

but in console
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).

i can’t write my name , quest and favorite color


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