@Gyroplast @emmatyping Hmm, I wonder how that works? Maybe it transcribes the emojis to text and the one that appears first in the alphabetical order is deemed the greater one?
So, Apple > Orange means A > O and F > W ?
That's some weird behaviour right here haha
How does
'π¦' > 'πΊ' == True
make sense?
Computers are narrow-minded, and do numbers only. Humans don't like numbers much, and wrote all the letters and glyphs they wanted to use with computers on a huge list, and gave every letter a unique number, and called that a "Unicode codepoint" to sound really smart.
The codepoint of FOX FACE (π¦) is 129418, and the codepoint of WOLF FACE (πΊ) is 128058.
If I'm asking the lightning-infused rock to compare two single characters, which both emojis really are, it will first implicitly look up their respective codepoints, and compare those numbers. 129418 > 128058 is patently true.
Γons ago, with ASCII, people did a lot of clever things with those "codepoints", like switching between upper and lower case by flipping a single bit of a character, until this broke hilariously with umlauts and their ilk.
"Don't bit-bang or numerically work with ASCII!" is the cautionary tale.
@Gyroplast @emmatyping After fiddling around, strangely, running
"π¦" == 12948 returns false.
Also, it seems like emojis are always greater than strings with just letters in them, no matter the string length. But the len of "π¦" seems to be only 1 which makes sense, but then why is π¦ greater than "aaaaaaaaaaaa..." ? That's confusing!
String comparisons are a massive rabbit hole (heh), and depend entirely on the implementation of a programming language.
In Python, "π¦" == 129418 == False, because you are testing equality of two objects of different types, a str and an int, which is always False as per spec.
The comparison of two strings is done by comparing the numerical value of each character, one by one, and the numerical value of an emoji character is typically rather high, as opposed to an old-school ord("a") == 97. Comparison stops as soon as two compared characters are not equal, you don't need to look at the rest of the string: "z" > "aaa" == True.
Strings (instances of str) compare lexicographically using the numerical Unicode code points (the result of the built-in function ord()) of their characters. 3
It doesn't matter to Python if it's a single character or a string, this was a C thing my addled brain regurgitated. Sowwy.
@Gyroplast @emmatyping That's great to know, thanks for the insights! 
I'll save this post for later in case I need it! Thanks!
Oi, I hope you won't need it! :D
This is the kind of arcane implementation detail nobody should ever encounter beyond "always use the intended, provided functions to manipulate, compare or sort strings instead of trying to be clever".
If you run into "collations" in a database context, you can now officially nod sagely, sigh heavily, and feel superior.
Bonus: printing an "ASCII"-table in 2026 is so much more colorful!
$ python -c "print(ord('π¦'))"
129418
$ python -c "print(ord('πΊ'))"
128058
$ python -c "for i in range(ord('πΊ'), ord('πΊ') + 40): print(chr(i), end='')"
πΊπ»πΌπ½πΎπΏππππππ
πππππππππππππππππππππππππππ π‘