Feddit.it
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
KHTangent@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years ago

Swapping integers in Python

lemmy.world

message-square
8
link
fedilink
  • cross-posted to:
  • python@programming.dev
67

Swapping integers in Python

lemmy.world

KHTangent@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years ago
message-square
8
link
fedilink
  • cross-posted to:
  • python@programming.dev
  • Jason Novinger@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    I raise you

    @lambda _: _()
    def result() -> int:
        global a; global b; a, b = b, a
    

    hat tip to @sisyphean@programming.dev via Cursed Python

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

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: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

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

  • 200 users / day
  • 776 users / week
  • 1.8K users / month
  • 10.4K users / 6 months
  • 146 local subscribers
  • 35.6K subscribers
  • 1.8K Posts
  • 38.1K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org