String Formatting with %, Part 2


#1


Traceback (most recent call last):
File "python", line 6, in
TypeError: not all arguments converted during string formatting

Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: not all arguments converted during string formatting


I do not know why I am getting these error messages. Can someone please help. The errors appear after I hit enter on my 3rd answered question.


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

&s can't be used in string formatting, try to replace it with correct operator.


#3

What is the correct operator?

Below are the given instructions-

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.


#4

I just copied the %s in and it worked


#5

Just as the instructions said.


#6

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