15 String Formatting with %


#1

Anyone sure why it's not accepting my answers? Won't allow to save and submit. or reset

What is your name? John
What is your quest? win
What is your favorite color? blue

Thanks


#2

@dusker,
They want you to use the variables from your raw_input
in

print "Ah, so your name is ___, your quest is ___, " \
"and your favorite color is ___." ___ (name, quest, color)

The Instruction:
01. Inside the string, replace the three ___ with %s.
02. After the string but before the three variables, replace the final ___ with a %.
03. Hit Save & Submit Code.


#3

So, it accepted this code and approved for submittal

meal = 44.50
tax = 0.0675
tip = 0.15

meal = meal
total= meal + meal * tip

print("%.2f" % total)


#4

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