Tagged articles
f-strings
13 articles · Page 1 of 1
This article systematically introduces the most useful Python syntax sugar—from variable swapping and chain comparisons to comprehensions, decorators, context managers, argument packing, unpacking, ternary expressions, and f‑strings—showing concise examples and explaining why each feature makes code clearer and more Pythonic.
Pythonargument-unpackingcontext-managers
0 likes · 11 min read

This tutorial walks through Python's two main string formatting techniques—classic % placeholders and modern f‑strings—detailing specifiers like %d, %f, %s, %.2f, and providing concrete code examples that show how each method formats name, age, and salary variables.
PythonString FormattingTutorial
0 likes · 3 min read

Discover five versatile techniques for Python’s print()—from simple string concatenation and comma separation to modern f‑strings, percent formatting, and the .format() method—complete with clear examples and guidance on when to use each approach for clean, readable output.
Code ExamplesString Formattingf-strings
0 likes · 5 min read

This article explains the most frequent mistakes developers make when defining Python functions—such as mutable default arguments, inconsistent return types, overly large functions, outdated string formatting, missing type hints, manual index tracking, and misuse of try‑except for flow control—and provides clear, best‑practice solutions with code examples to write cleaner, more maintainable, and efficient Python code.
Pythonenumerateerror handling
0 likes · 8 min read

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

Python 3.12 introduces enhanced error messages, expanded f‑string capabilities, inline collection optimizations, new buffer protocol support, refined type‑annotation syntax, additional language tweaks, and performance‑focused garbage‑collector changes, providing developers with clearer diagnostics and more expressive, efficient code constructs.
3.12error messagesf-strings
0 likes · 10 min read

This article reviews recent Python standard‑library enhancements, showing how pathlib replaces os.path, secrets supersedes os.urandom, zoneinfo replaces pytz, dataclasses improve on namedtuple, proper logging outperforms print, f‑strings beat format, tomllib replaces tomli, and setuptools supersedes distutils, with code examples for each.
LoggingPythondataclasses
0 likes · 13 min read

Python 3.12 introduces enhanced error messages for NameError, SyntaxError, and ImportError, expands f‑string capabilities with unrestricted expressions and deeper nesting, adds inline collection optimizations, and brings numerous type‑annotation improvements such as TypedDict unpacking, the override decorator, and new parameter‑type syntax.
3.12PEPerror handling
0 likes · 12 min read

Python 3.12.0 introduces flexible f‑string parsing, support for the buffer protocol, new debugging/profiling APIs, independent subinterpreter GILs, performance optimisations, improved error messages, and expanded type‑annotation syntax, offering developers a more powerful and maintainable language runtime.
3.12PEPf-strings
0 likes · 7 min read

This article reviews the most useful additions to the Python standard library—Pathlib, Secrets, Zoneinfo, Dataclasses, proper logging, f‑strings, Tomllib and Setuptools—explaining why they replace older modules, showing concise code examples, and offering guidance on adopting them in everyday projects.
LoggingPythondataclasses
0 likes · 14 min read

The first beta of Python 3.12 has been released, introducing new generic class type‑annotation syntax, more flexible f‑string parsing, improved error messages, performance enhancements, Linux profiler support, several new PEPs for typing, and the removal of deprecated features such as distutils, with the final release slated for October 2 2024.
Betadeprecationf-strings
0 likes · 2 min read

This article introduces the most useful additions and modern replacements in recent Python releases—including pathlib, the secrets module, zoneinfo, dataclasses, proper logging, f‑strings, the built‑in tomllib, and the transition from distutils to setuptools—showing why and how to adopt them in everyday code.
LoggingPythondataclasses
0 likes · 15 min read

Discover four practical Python techniques—list/dict/set comprehensions, namedtuple structures, enumerate/zip iteration, and f-string formatting—that boost code readability and efficiency, helping beginners transition from a simple “Hello World” to writing clean, maintainable scripts in their development journey.
ComprehensionsNamedtuplePython
0 likes · 3 min read
