This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by noxiii
over 10 years

Advanced Printing - Error after input.

Posting plain text and image for reference.

When I answer the third question and hit return, I get this error:

What is your name? blake
What is your quest? i seek the grail
What is your favorite color? green... no wait!
Traceback (most recent call last):
  File "python", line 6, in <module>
ValueError: unsupported format character ',' (0x2c) at index 21

alt text

alt text The code I used:

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 %.” % (name, quest, color)

Answer 524bf6da80ff336edd001eae

0 votes

Permalink

%s - not %, this is to tell the interpreter how to convert the values to string before printing, s is for string

points
Submitted by Jonatan
over 10 years

1 comments

noxiii over 10 years

ahh, duh - Thank you for your response!