Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Python String Formatting: Recap & Summary

Give Feedback

Summary of what you’ve learned in this course:

  • String Format with %
  • String Format with .format()
  • f-strings
  • Template Strings

Knowing which method to use to format strings can be confusing, In this lesson you’ll see a handy flowchart to help you decide which formatting method to use.

Comments & Discussion

philraffsr on April 11, 2019

Simple and straightforward. Would like to have seen some decimal/left-right justification/zero-fill examples.

Wiggers on April 11, 2019

Why in books does it do this print('Hey ' ;name; 'There is an error '; string(errno) ? It confused me the first time some one put f strings in my code!

Eribertt on April 12, 2019

Formatting using the f-string method is the one i preferred the most.

Pavel Zaikin on April 14, 2019

A lot of examples: pyformat.info

Malef on April 14, 2019

Thank for straightforward and informative way of presenting information.

adriaprat on April 15, 2019

As philraffsr said, some decimal/left-right justification/zero-fill examples would be nice. 😉

gracebr28 on June 4, 2019

Thanks for the great tutorial!

Abby Jones on June 27, 2019

Very informative!

aradim on July 14, 2019

Very nice! Thank you.

Pakorn on Dec. 17, 2019

great tutorial

Become a Member to join the conversation.