Format III: Keyword Arguments

Published by Alessandro Manicone in

For each challenge of this series you do not need to submit a function. Instead, you need to submit a formatted template string to get a certain outcome.

Write a template string according to the following example:

Example

template = "yourtemplatestringhere"
template.format("name", me = "John", him = "Joe") ➞ "My name is John. His name is Joe."

Tips

You can pass keyword arguments to .format() that can then be accessed by placing the key inside a place holder.

For example:

"I'm {age} years old.".format(age = 30) ➞ "I'm 30 years old."

Notes

  • Submit a string, not a function.
  • Do not change the name of the variable template.
  • You can find all the exercises in this series over here.
Watch a quick demo on how Edabit works.