← Back to challenges

Format III: Keyword Arguments

PythonMediumstringsformattinglanguage_fundamentals

Instructions

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

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: The Full Length of a Google