this post was submitted on 17 Apr 2025
176 points (93.1% liked)
memes
14348 readers
3878 users here now
Community rules
1. Be civil
No trolling, bigotry or other insulting / annoying behaviour
2. No politics
This is non-politics community. For political memes please go to [email protected]
3. No recent reposts
Check for reposts when posting a meme, you can only repost after 1 month
4. No bots
No bots without the express approval of the mods or the admins
5. No Spam/Ads
No advertisements or spam. This is an instance rule and the only way to live.
A collection of some classic Lemmy memes for your enjoyment
Sister communities
- [email protected] : Star Trek memes, chat and shitposts
- [email protected] : Lemmy Shitposts, anything and everything goes.
- [email protected] : Linux themed memes
- [email protected] : for those who love comic stories.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Python, but this is actually defined and documented behavior.
Edit: to illustrate what I mean:
this actually is
not ()
(the lack of space makes it look like a function),()
is a tuple, in python an empty collection returnsFalse
, this is to make checks simpler. You can type:instead of
not
negates it so you getTrue
converts resulting
bool
type into a string representationThis might feel odd, but that's also documented.
min()
not only allows to compare two numbers like it is in most languages, but you can also provide a sequence of values and it will return the smallest one.String is a sequence of letters.
Letters are comparable according to ASCII (so you can do sorting). In ASCII table capital letters are first, so the 'T' is the smallest value.
this just converts 'T' to Unicode value which is 84
This creates a sequence of numbers from 0 to 83
This works like
min()
except adds up all the numbers in the sequence together, so in our case 0+1+2+3+...+83 = 3486reverse of
ord()
, converts Unicode value to a character.