Self-Proclaimed ML Engineer Discovers How Strings Work

Self-Proclaimed ML Engineer Discovers How Strings Work
python-memes, sorted-memes, string-comparison-memes, ml-engineer-memes, lexicographical-sorting-memes | ProgrammerHumor.io

Behold, the "ML Engineer" who discovered that Python sorts strings alphabetically instead of numerically! The horror! Next breaking news: water is wet.

What we're witnessing here is the classic "I didn't read the docs but it's definitely the language's fault" syndrome. Python's sorted() is working perfectly—it's sorting ["9%", "83%", "25%"] as strings, exactly as it should when you give it strings.

Pro tip for our aspiring "ML Engineer": try sorted([int(x.strip('%')) for x in a]) next time. Or maybe stick to Excel?

More Like This