Comparison of strings is lexicographically-sensitive
Source: Dev.to
Day 78 – December 2nd, 2025
I need to buckle down, as I’m still lagging on day 3 & 4 goals (“Day 3‑4: Control structures (if‑else, loops)”), as well as day 5 (and 6) goals (“Day 5‑6: Functions and modules”), and Day 7 target (exercises). If I haven’t covered this, I can’t make progress on day 8‑77 goals.
Goals
As extracted from the Python for Software Development textbook by Halvorsen (n.d.):
- Plotting in Python ✅
- Subplots ✅
- Exercises ✅
- If … Else
- Arrays
- For Loops
- Nested For Loops
- While Loops
- Exercises
- Creating Functions in Python – Introduction
- Functions with multiple return values
- Exercises
- Creating Classes in Python
- The
__init__()Function - Exercises
- Creating Python Modules
- Exercises
Notes
Python for Data Science, AI & Development Course (IBM) (Santarcangelo, n.d.) – Module 2: Python Programming Fundamentals – Conditions and Branching
- The block of code under an
ifstatement only runs when the condition isTrue. - Comparison of strings is lexicographically‑sensitive (comparison is done character‑by‑character based on Unicode/ASCII ordering) (see also Google, 2025a; Google, 2025b). That’s why
"10"comes before"2"when compared as strings.
References
- Google. (2025b). Google Search with AI. [Large language model].
- Halvorsen, H. (n.d.). Python.
- Santarcangelo, J. (n.d.). Python for data science, AI & development [MOOC]. Coursera.