Hint: You can adjust the default video playback speed in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

String Formatting With the % Operator

Give Feedback

The interpolation operator % is used to do simple positional formatting:

>>>
>>> name = 'Bob'
>>> 'Hello, %s' % name
"Hello, Bob"

In this lesson, you’ll learn how to use % to format strings as well as the different format specifiers you can use to generate nicely formatted output.

Comments & Discussion

Patricio Urrutia on June 10, 2020

Hi, thanks for the course!

What do you mean with Legacy Code?

Daniel Faria on July 3, 2020

badc0ffee – that made me laugh hard

Become a Member to join the conversation.