WSQ11 – Go Bananas

Colored Bananas flickr photo by Cleber Quadros shared under a Creative Commons (BY-NC) license

What To Do

Write a function called find_bananas which receives a single parameter called filename (a string) and returns a positive integer which is the number of times the word (string) “banana”  (or “BANANA” ) is found in the file. The banana can be any case (‘BaNana’ or ‘BANANA’ or ‘banana’, etc) and they can be “stuck together” like “banAnaBANANA” (that counts as two). Create your own test file (plain text) to check your work.

What to Submit

As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ11 on your post so our blog hub picks that up.

You should include your code as a link to GitHub.

And of course, leave any questions here as well as asking those questions in our Facebook group so we all see your question posted there.

Feature Image Credit

Colored Bananas flickr photo by Cleber Quadrosshared under a Creative Commons (BY-NC) license

CC BY-SA 4.0 WSQ11 – Go Bananas by Bauer Ken is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.