Reputation: 11
name = input ("What is your name?")
quest = input("What is your quest?")
color = input ("what is your favorite color")
print ("Ah, so your name is {}, your quest is{}, and your favorite color is{}.")str.format(name, quest, color)
Upvotes: 1
Views: 124
Reputation: 11443
you need to give argument numbers to .format
. try below.
print ("Ah, so your name is {0}, your quest is {1}, and your favorite color is {2}.".format(name, quest, color))
Upvotes: 0
Reputation: 1121584
.format()
is a method on strings. You need to call it on your template string:
print("Ah, so your name is {}, your quest is{}, and your favorite color is{}.".format(name, quest, color))
Note how the .format()
follows directly after the "Ah, so ... is{}."
string definition, and the result of that method is passed to the print(...)
function for printing.
Upvotes: 1