Tagged articles

percent operator

3 articles · Page 1 of 1
Code Mala Tang
Code Mala Tang
Jan 31, 2025 · Fundamentals

Master Python String Formatting: From % Operator to f-Strings

This article explores Python's string formatting techniques—from the classic % operator and the flexible .format() method to modern f-strings—detailing their syntax, advantages, disadvantages, and additional tools like format_map, Template, and zfill, helping developers choose the most readable and efficient approach.

String Formattingf-stringsformat method
0 likes · 7 min read
Master Python String Formatting: From % Operator to f-Strings
Test Development Learning Exchange
Test Development Learning Exchange
Nov 26, 2023 · Fundamentals

Using the % Placeholder for String Formatting in Python

This article explains Python's % placeholder for string formatting, covering basic specifiers, multiple value substitution using tuples, dictionaries, and f-strings, and advanced formatting options like width, padding, and precision, accompanied by clear code examples.

String Formattingpercent operatorplaceholder
0 likes · 5 min read
Using the % Placeholder for String Formatting in Python