Tagged articles
programming-fundamentals
14 articles · Page 1 of 1
This article explains eight practical applications of Python dictionaries—including data mapping, configuration management, counting, caching, graph representation, grouping, statistical analysis, and simple database simulation—each illustrated with clear code snippets.
code-examplesdata-structuresdictionary
0 likes · 4 min read

This article introduces Python's core built-in conversion functions—including int(), float(), str(), list(), tuple(), dict(), set() and bool()—explaining their syntax, parameters, example usages, and key best‑practice considerations for reliable type conversion in programming.
Type Conversionbuilt-in-functionsexamples
0 likes · 6 min read

This article explains the surprising behavior of Python sets when mixing True, integers, floats, and how the distinction between the is operator and the == operator determines element uniqueness, while also reviewing Python's basic immutable and mutable data types.
data typesequalityis-operator
0 likes · 4 min read

This article explains the purpose and syntax of Python's pass statement, illustrating beginner, intermediate, and advanced usage scenarios—including placeholders in classes and functions, empty control structures, decorator templates, iterators, context managers, and exception handling—providing clear code examples for each case.
code-examplescontrol-flowpass statement
0 likes · 5 min read

This article explains Python's syntax sugar—including list, set, and dictionary comprehensions, conditional expressions, generator expressions, star unpacking, multiple assignment, function annotations, context managers, and property decorators—showing how each feature makes code more concise, readable, and efficient.
decoratorsprogramming-fundamentalssyntax-sugar
0 likes · 4 min read

This article explains Python's exception handling with try‑except‑finally blocks, demonstrates common error‑handling patterns, and presents ten practical debugging techniques—including print statements, assertions, logging, breakpoints, traceback, unit testing, and profiling—each illustrated with clear code examples.
Exception Handlingerror-handlingprogramming-fundamentals
0 likes · 6 min read

This article explains Python's object model, showing that numbers, strings, lists, tuples, sets, dictionaries, functions, classes, and modules are all objects, and then thoroughly introduces decorators, describing their design‑pattern nature, typical uses such as logging and profiling, and demonstrates class‑decorator implementation with practical examples.
Design PatternObjectsclass-decorator
0 likes · 3 min read

This article explains why Python's print() adds a newline by default, demonstrates how to modify the end parameter or use rstrip() to print multiple outputs on a single line, and provides clear code examples for customizing print behavior when processing files.
File Readingend-parameternewline
0 likes · 5 min read

This article walks through a Python fan's question about implementing algebraic functions, presenting two solutions—one using basic arithmetic operators and another leveraging the sympy library—complete with code snippets, explanations, and visual illustrations to help beginners understand the approach.
Code ExamplePythonSymPy
0 likes · 4 min read

This article walks through creating a detailed Python Turtle drawing of the 2022 Winter Olympics mascot Bing Dwen Dwen, explains each drawing step, and shows how to package the script into a standalone executable using PyInstaller.
Tutorialbing-dwen-dwenprogramming-fundamentals
0 likes · 9 min read

This article explains Python's for loop in depth, covering basic syntax, the optional else clause, the concepts of iterables and iterators, how to implement custom iterators and iterable objects, the loop's execution flow, an equivalent while‑loop implementation, and a step‑by‑step disassembly of the generated bytecode.
Iterablebytecodedisassembly
0 likes · 12 min read

The article reveals that many recent Python books mistakenly claim variable names are limited to letters, digits, and underscores, explains how Python 3 fully supports Unicode identifiers—including Chinese characters—citing official documentation, PEP 3131, and practical code examples.
Identifierspep3131programming-fundamentals
0 likes · 6 min read

The article explains Python's built‑in divmod function, which returns a tuple of the integer quotient and remainder for two numbers, shows its syntax, behavior with different numeric types, and provides example code illustrating typical usage.
built-in functiondivmodprogramming-fundamentals
0 likes · 2 min read

This article explains Python's built‑in next() function, its syntax with an optional default argument, demonstrates how it retrieves successive items from an iterator, and highlights differences in Python 3 file handling and default‑value behavior.
built-in functioniteratornext
0 likes · 3 min read
