Special Python String Formatting in Logging and Unit Conversion

Learn special Python string formatting in different cases

In this article, some special cases of string formatting will be discussed. Both the old and new styles of string formatting will be introduced. While f-string formatting is recommended to be used in most cases now, the old percent sign formatting and str.format() still have their advantages in some special cases. After that, the library will be introduced which is very convenient to convert values to different units.

--

--

I’m a Software Developer (https://www.superdataminer.com) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Lynn Kwong

I’m a Software Developer (https://www.superdataminer.com) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.