lemmy.4d2.org
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 8 months ago

Rule

lemmy.blahaj.zone

message-square
7
link
fedilink
2

Rule

lemmy.blahaj.zone

Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 8 months ago
message-square
7
link
fedilink
alert-triangle
You must log in or register to comment.
  • bob_lemon@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    8 months ago
    import re
    
    def is_even(i: int) -> bool:
        return re.match(r"-?\d*[02468]$", str(i)) is not None
    
    • lime!@feddit.nu
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 months ago

      i was gonna suggest the classic

      re.match(r"^(..)\1*$", "0" * abs(i)) is not None
      
  • Euphoma@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    8 months ago

    return true

    is correct around half of the time

    • aliser@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago
      return Math.random() > 0.5
      

      would also be correct about half the time

    • ImplyingImplications@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago
      assert IsEven(2) == True
      assert IsEven(4) == True
      assert IsEven(6) == True
      

      All checks pass. LGTM

  • dadarobot@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    8 months ago
    If number%2 == 0: return("Even")
    Else: return("odd") 
    
    • istdaslol@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago

      Not all ARM CPUs support mod operations. It’s better to use bit operations. Check if the last bit is set. If set it’s odd else it’s even.

196@lemmy.blahaj.zone

196@lemmy.blahaj.zone

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: !196@lemmy.blahaj.zone

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

  • No bigotry (transphobia, racism, etc…)
  • No genocide denial
  • No support for authoritarian behaviour (incl. Tankies)
  • No namecalling
  • Accounts from lemmygrad.ml, threads.net, or hexbear.net are held to higher standards
  • Other things seen as cleary bad

Posting rules:

  • No AI generated content (DALL-E etc…)
  • No advertisements
  • No gore / violence
  • Mutual aid posts are not allowed

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn’t adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196’s:

  • !196@lemmy.world
  • !onehundredninetysix@lemmy.blahaj.zone
Visibility: Public
globe

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

  • 1.19K users / day
  • 2.59K users / week
  • 5.13K users / month
  • 15.7K users / 6 months
  • 3 local subscribers
  • 18K subscribers
  • 5.67K Posts
  • 34.3K Comments
  • Modlog
  • mods:
  • Moss@lemmy.blahaj.zone
  • greembow@lemmy.blahaj.zone
  • moss@lemmy.world
  • Queue@beehaw.org
  • funky-rodent [he/him]@lemmy.blahaj.zone
  • Peachy [they/she] @lemmy.blahaj.zone
  • greembow@lemmy.world
  • remotelove@lemmy.ca
  • A_Very_Big_Fan@lemm.ee
  • qaz@lemmy.blahaj.zone
  • A_Very_Big_Fan@lemmy.world
  • qaz@lemmy.sdf.org
  • qaz@lemmy.world
  • qaz@sh.itjust.works
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org