schoenwolf-schroeder
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@Schal330@lemmy.world to Programmer Humor@programming.dev • 9 months ago

It must be a silent R

lemmy.world

message-square
120
fedilink
1

It must be a silent R

lemmy.world

@Schal330@lemmy.world to Programmer Humor@programming.dev • 9 months ago
message-square
120
fedilink
  • @cypherix93@lemmy.world
    link
    fedilink
    English
    0•9 months ago

    "strawberry".split('').filter(c => c === 'r').length

    • Tiefling IRL
      link
      fedilink
      0•9 months ago

      'strawberry'.match(/r/ig).length

    • @SpaceNoodle@lemmy.world
      link
      fedilink
      0•9 months ago

      len([c if c == ‘r’ for c in “strawberry”])

      • @MrLLM@ani.social
        link
        fedilink
        English
        0•9 months ago
        import re; r = [c for c in re.findall("r", "strawberry")]; r = "".join(r); len(r)
        
    • anti-idpol action
      link
      fedilink
      0•9 months ago

      (\r (frequencies “strawberry”))

    • AwkwardLookMonkeyPuppet
      link
      fedilink
      English
      0•9 months ago

      Are you implying that it’s running a function on the word and then giving a length value for a zero indexed array?

      • @Sluyter548@lemmy.world
        link
        fedilink
        0•9 months ago

        A zero indexed array doesn’t have a different length ;)

Programmer Humor@programming.dev

!programmer_humor@programming.dev

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: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
  • 83 users / day
  • 460 users / week
  • 1.19K users / month
  • 3.71K users / 6 months
  • 23.2K subscribers
  • 1.22K Posts
  • 34.2K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne
  • BE: 0.19.3
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org