Python Programming B14: Composite Data Types (Part 2)

Python Programming B14: Composite Data Types (Part 2)

9.3 Tuple Type A tuple (tuple) is very similar to a list and is also an ordered sequence type, but the biggest difference is that tuples are immutable objects. Once created, their elements cannot be modified. The immutable nature of tuples makes them particularly suitable for applications that require traceable history, such as recording versions, … Read more

A Comprehensive Guide to the Tuple Container in C++

A Comprehensive Guide to the Tuple Container in C++

1. Basic Concepts: Why Do We Need Tuples? 1.1 The Role and Characteristics of Tuples In C++ programming, we often need to combine multiple different types of data into a single entity. The traditional approach is to use structures (struct) or pairs (pair), but these methods have limitations in terms of flexibility and convenience. The … Read more

Summary of Python Basics

Summary of Python Basics

1. Python Basics List: A built-in data type in Python is the list: list. A list is an ordered collection that allows adding and removing elements at any time. >>> classmates = ['Michael', 'Bob', 'Tracy'] tuple: Another type of ordered list is called a tuple: tuple. A tuple is very similar to a list, but … Read more

C++23 forward_like_tuple

C++23 forward_like_tuple

“Transferring a person’s warmth to another’s chest”—— Eason Chan “Love Transfer” Introduction The updates to the C++23 language core are minimal, and I have not felt motivated to upgrade. However, considering that next year is 2026, using C++23 still seems reasonable, right? Among the features in C++23 that can significantly simplify code, the most prominent … Read more

A Comprehensive Guide to Python Collections: Unlocking Efficient Data Structures

A Comprehensive Guide to Python Collections: Unlocking Efficient Data Structures

Background Although Python provides very flexible data structures such as lists and dictionaries, the <span>collections</span> module offers high-performance container data types that can significantly optimize code efficiency and readability. This article will delve into the six core tools within this module to help you write more elegant Python code and avoid reinventing the wheel. Environment … Read more