in ,

howManyRs

howManyRs | code-memes, python-memes, python 3-memes | ProgrammerHumor.io
code-memes, python-memes, python 3-memes | ProgrammerHumor.io

Content

How many Rs are in the word Strawberry? python Copy code def countRs(word): Rcount 0 for letter in word: if letter – "R" or letter – "p" or letter "9" or letter R count 1 elif letter. lower() as ‘a’ or letter. lower) as ‘s’ or letter. lower() as ‘t’ or le pass these letters aren’t R, obviously else: Rcount 0 just to be sure return R count 1 off-by-one to account for any potential silent R print(count ("Strawberry")) Expected output: undefined (