Schal330@lemmy.world to Programmer Humor@programming.dev · 3 months agoIt must be a silent Rlemmy.worldimagemessage-square114fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageIt must be a silent Rlemmy.worldSchal330@lemmy.world to Programmer Humor@programming.dev · 3 months agomessage-square114fedilink
minus-squareSpaceNoodle@lemmy.worldlinkfedilinkarrow-up0·3 months agolen([c if c == ‘r’ for c in “strawberry”])
minus-squareMrLLM@ani.sociallinkfedilinkEnglisharrow-up0·3 months agoimport re; r = [c for c in re.findall("r", "strawberry")]; r = "".join(r); len(r)
len([c if c == ‘r’ for c in “strawberry”])
import re; r = [c for c in re.findall("r", "strawberry")]; r = "".join(r); len(r)