Distinguishing Strings from Sequences in Python
Determining Whether a Value Is a String or a Sequenec
In Python, distinguishing between string and sequence types (e.g., lists, tuples, or other iterable containers) requires careful type inspection—especially since strings are technical sequences themselves but often need special handling.
Core Strategy
Use isinstance() with precise type check ...
Posted on Sun, 11 Oct 2026 16:47:36 +0000 by therealairness
Building Custom Sequence Types in Python: A Deep Dive
Python categorizes sequence types in to several families. Container sequences (like list, tuple, and deque) can hold items of mixed types. Flat sequences (like str, bytes, bytearray, and array.array) store homogeneous data and are iterable with for loops. Mutable sequences (list, deque, bytearray, array) allow in-place modification, while immut ...
Posted on Fri, 09 Oct 2026 16:16:53 +0000 by davey10101
Built-in Functions and Operations for Python Sequences
Sequences in Python divide into mutable and immutable categories. Lists permit modification after creation, while tuples and strings do not.
Membership Operators
Use in and not in to verify whether a value appears inside a sequence.
'x' in 'python'
# False
'z' not in 'hello'
# True
The del Statement
del removes references. It can eliminate en ...
Posted on Tue, 06 Oct 2026 16:37:27 +0000 by agsparta
Kotlin Collections: Iterators, Ranges, and Sequences
Iterators
Kotlin provides standard iterator mechanisms for traversing collection elements. An iterator is an object that grants sequential access to elements without exposing the underlying collection structure. This proves invaluable when processing each element individually, such as printing values or applying transformations.
Any class exten ...
Posted on Sun, 10 May 2026 19:12:37 +0000 by Aérolithe