Strings

17 articles
Interview Preparation Intermediate

9.16 Hands-on Exercises

Practice programs reinforcing Python string concepts -- a log-level analyzer, an IP address extractor, a config file parser, and a password …

Jan 20, 2026 Read more
Interview Preparation Intermediate

9.15 Interview Questions

Frequently asked and scenario-based Python string interview questions covering immutability, slicing, join() vs +=, and classic coding …

Jan 20, 2026 Read more
Interview Preparation Intermediate

9.14 Common Mistakes

The most common string bugs in Python -- expecting a method to mutate in place, mismatching find() and index() error behavior, off-by-one …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.13 Best Practices

Reaching for join() instead of += in loops, f-strings as the default formatting choice, comparing strings with == rather than is, and …

Jan 20, 2026 Read more
Interview Preparation Intermediate

9.12 Strings in DevOps and AWS

The standard raw-text-to-structured-fields pipeline applied to real infrastructure text -- Apache/Nginx/syslog parsing, Amazon Resource …

Jan 20, 2026 Read more
Interview Preparation Intermediate

9.11 Memory and Performance

Why string immutability makes join() outperform += in a loop by turning O(n^2) into O(n), PEP 393's variable-width memory representation, …

Jan 20, 2026 Read more
Interview Preparation Intermediate

9.9 String Algorithms

Classic string algorithms built from the operators and methods covered earlier -- reverse, palindrome and anagram checks, character …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.8 String Functions

Built-in functions that operate on strings from the outside -- len(), max(), min(), sorted(), chr(), ord(), ascii(), repr(), and str() -- as …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.7 Common String Methods

The str type's built-in method set grouped by purpose -- case conversion, searching, validation, modification, splitting/joining, alignment, …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.6 String Formatting

The three ways to format strings in Python -- percent-style, str.format(), and f-strings -- plus alignment, padding, number/currency/date …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.5 String Operators

Concatenation, repetition, membership testing, comparison, lexicographical ordering, iteration, and len() — the operators that work directly …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.4 String Indexing and Slicing

Positive and negative indexing, slicing with s[start:stop:step], why slicing never raises IndexError, extended slicing for reversal, and …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.3 Escape Characters

The full table of Python string escape sequences, including the less common octal and hex character codes, expanding on the introductory …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.2 Creating Strings

Single, double, and triple quotes, multiline and empty strings, raw strings for paths and regex, and why every Python 3 str is Unicode by …

Jan 20, 2026 Read more
Interview Preparation Beginner

9.1 Introduction to Strings

What a string is, why it's the universal interface between a program and the outside world, how it's represented in memory, and why …

Jan 20, 2026 Read more
Interview Preparation Beginner

Strings

String concatenation, length, substring extraction, case conversion, splitting, and comparison in Bash.

Jan 20, 2026 Read more