How to use 'from' in a list?


#1

https://www.codecademy.com/courses/learn-python/lessons/strings--console-output/exercises/string-formatting
on part 15, I tried to put " save soandso from the castle" in place of ‘quest’ but ‘from’ was in blue and won’t run in a list. Sorry for the stupid question but I really don’t know what to do!

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." ___ (bob, save soandso from the castle, purple)

#2

Since those are all identifiers, bob will raise an exception. The from is colored because the editor thinks it should be colored. That’s called syntax highlighting.

The cure for this is to write all three arguments as string values, in quotes.


#3

Thank you so much! I really appreciate it!