7 points

Is it bad that I already knew what this would print the moment I read the meme?

permalink
report
reply
3 points

You can’t tell me what to do

permalink
report
reply
22 points
>>> print(print(chr(sum(range(ord(min(str(not()))))))))None
permalink
report
reply
7 points

amoug

permalink
report
parent
reply
133 points

In case anyone’s curious:

not() # True
str(not()) # 'True'
min(str(not())) # 'T'
ord(min(str(not()))) # 84
range(ord(min(str(not())))) # range(0, 84)
sum(range(ord(min(str(not()))))) # 3486
chr(sum(range(ord(min(str(not())))))) # 'ඞ'
permalink
report
reply
30 points
*

You forgot the most important part!

print(chr(3486)) # ඞ
permalink
report
parent
reply
1 point

Looks like telugu

permalink
report
parent
reply
5 points

Why is that thing scary?

permalink
report
parent
reply
7 points

It looks like the characters from the game Among Us.

permalink
report
parent
reply
23 points

It could be an impostor

permalink
report
parent
reply

It could be a monster.

permalink
report
parent
reply
10 points

Why does not without a parameter return True? I’m starting to like the fact that I haven’t touched python in a while.

permalink
report
parent
reply
23 points

I think it’s because not() is equivalent to not(None), and since None is falsy not(None) returns True.

permalink
report
parent
reply
6 points

Are you sure?

I can’t test it now, but to me it looks like () is an empty tuple. Python behavior is that for logic operations empty set equals to false. Then we apply not to get True. Not having space between not operator and parentheses makes it look like it is a function.

permalink
report
parent
reply
5 points

Why is literally nothing equivalent to None? Is it because None is the default value of an optional parameter? (If so why oh why is it optional)

permalink
report
parent
reply
2 points

in J, many other languages, not null is null.

permalink
report
parent
reply
5 points

God I love python

permalink
report
parent
reply
20 points

What kind of dumb language is this?

permalink
report
parent
reply
22 points
*

Python, but this is actually defined and documented behavior.

Edit: to illustrate what I mean:

not() # True

this actually is not () (the lack of space makes it look like a function), () is a tuple, in python an empty collection returns False, this is to make checks simpler. You can type:

if my_list:
  do something

instead of

if len(my_list) > 0:
  do something

not negates it so you get True

str(not()) # 'True'

converts resulting bool type into a string representation

min(str(not())) # 'T'

This 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.

ord(min(str(not()))) # 84

this just converts ‘T’ to Unicode value which is 84

range(ord(min(str(not())))) # range(0, 84)

This creates a sequence of numbers from 0 to 83

sum(range(ord(min(str(not()))))) # 3486

This works like min() except adds up all the numbers in the sequence together, so in our case 0+1+2+3+…+83 = 3486

chr(sum(range(ord(min(str(not())))))) # 'ඞ'

reverse of ord(), converts Unicode value to a character.

permalink
report
parent
reply
44 points

Python!

permalink
report
parent
reply
25 points

thanks I won’t do that 'cause it’s sus

permalink
report
reply

memes

!memes@lemmy.world

Create post

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 !politicalmemes@lemmy.world

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

Community stats

  • 14K

    Monthly active users

  • 4.4K

    Posts

  • 94K

    Comments