Tim's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
The Picard Maneuver@lemmy.worldM to memes@lemmy.world · 22 days ago

Don't do it

lemmy.world

message-square
31
fedilink
1

Don't do it

lemmy.world

The Picard Maneuver@lemmy.worldM to memes@lemmy.world · 22 days ago
message-square
31
fedilink
alert-triangle
You must log in or register to comment.
  • Zangoose@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    21 days ago

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

  • eta@feddit.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    22 days ago

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

  • LostXOR@fedia.io
    link
    fedilink
    arrow-up
    0
    ·
    22 days ago

    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())))))) # 'ඞ'
    
    • Ziglin (it/they)@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      22 days ago

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

      • LostXOR@fedia.io
        link
        fedilink
        arrow-up
        0
        ·
        22 days ago

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

        • brb@sh.itjust.works
          link
          fedilink
          arrow-up
          0
          ·
          21 days ago

          God I love python

        • Ziglin (it/they)@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          21 days ago

          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)

          • spooky2092@lemmy.blahaj.zone
            link
            fedilink
            English
            arrow-up
            0
            ·
            edit-2
            21 days ago

            Because nothing isn’t something, and something is true. It’s base Boolean logic where everything is either true or false. Null/nothing is false.

            It’s a weird way to think about conditionals, but it makes sense when you use them in real examples. In my case, I use them like this when I need to make sure that a variable has a value. So I can do something like

            If(variable){do things with the variable}else{do stuff when the variable doesn’t exist}

            • Ziglin (it/they)@lemmy.world
              link
              fedilink
              English
              arrow-up
              0
              ·
              21 days ago

              I understand that, it makes sense. But why does it not throw an error? The parameter is missing after all.

              • spooky2092@lemmy.blahaj.zone
                link
                fedilink
                English
                arrow-up
                0
                ·
                21 days ago

                No it’s not, “” (a null/empty string) is the parameter. Not every function needs a parameter to be valid, and negation is one of them. Negating nothing is something, so “not()” = “not(null)” = “not(false)” = “true”

              • takeda@lemm.ee
                link
                fedilink
                arrow-up
                0
                ·
                21 days ago

                Actually the explanation is wrong.

                not()
                

                is actually

                not ()
                

                not is a keyword not a function.

                Boolean of empty tuple is False and then not negates it.

                I explained it better here:

                https://lemm.ee/post/61594443/19783421

        • humanspiral@lemmy.ca
          link
          fedilink
          arrow-up
          0
          ·
          21 days ago

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

          • Pup Biru@aussie.zone
            link
            fedilink
            English
            arrow-up
            0
            ·
            21 days ago
            a  = null
            if not a:
               …
            

            if not a were null then an if that evaluates that would evaluate it as falsy… also if a would evaluate as falsy :/ that’s far weirder behaviour

        • takeda@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          21 days ago

          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.

    • devfuuu@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      22 days ago

      What kind of dumb language is this?

      • takeda@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        21 days ago

        Python, but this is actually defined and documented behavior.

      • LostXOR@fedia.io
        link
        fedilink
        arrow-up
        0
        ·
        22 days ago

        Python!

    • nutcase2690@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      22 days ago

      You forgot the most important part!

      print(chr(3486)) # ඞ
      
      • Landless2029@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        21 days ago

        Why is that thing scary?

        • JackbyDev@programming.dev
          link
          fedilink
          English
          arrow-up
          0
          ·
          21 days ago

          It looks like the characters from the game Among Us.

        • _g_be@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          21 days ago

          It could be an impostor

        • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮 @pawb.social
          link
          fedilink
          English
          arrow-up
          0
          ·
          21 days ago

          It could be a monster.

  • zitrone 🍋@lemmings.world
    link
    fedilink
    arrow-up
    0
    ·
    22 days ago
    >>> print(print(chr(sum(range(ord(min(str(not()))))))))
    ඞ
    None
    
    • grrgyle@slrpnk.net
      link
      fedilink
      arrow-up
      0
      ·
      21 days ago

      amoug

  • ramenshaman@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    22 days ago

    You can’t tell me what to do

  • ImplyingImplications@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    22 days ago

    It prints Unicode character #3486: ඞ

    • valkyrieangela@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      22 days ago

      GETOUTOFMYHEAD GETOUTOFMYHEAD GETOUTOFMYHEAD

    • protist@mander.xyz
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      22 days ago

    • OpenStars@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      22 days ago

      giggity

    • Jimbabwe@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      22 days ago

      𓂺

    • tedd_deireadh@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      22 days ago

      nice

memes@lemmy.world

memes@lemmy.world

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

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.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 348 users / day
  • 1.36K users / week
  • 3.43K users / month
  • 8.35K users / 6 months
  • 0 local subscribers
  • 14.6K subscribers
  • 4.7K Posts
  • 105K Comments
  • Modlog
  • mods:
  • Tenthrow@lemmy.world
  • The Picard Maneuver@lemmy.world
  • The Picard Maneuver@startrek.website
  • UI: unknown version
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org