Learn

Remember, we used the % operator to replace the %s placeholders with the variables in parentheses.

name = "Mike" print "Hello %s" % (name)

You need the same number of %s terms in a string as the number of variables in parentheses:

print "The %s who %s %s!" % ("Knights", "say", "Ni") # This will print "The Knights who say Ni!"

Instructions

1.

Now it’s your turn! We have ___ in the code to show you what you need to change!

  1. Inside the string, replace the three ___ with %s.
  2. After the string but before the three variables, replace the final ___ with a %.
  3. Hit Run.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?