I am a total newbie to programming and have been researching/reading as much as I can but have yet to find a specific answer to help me out.
My question is as follows, if I have an array with multiple words as follows: myArray= "this","makes","bats","look","funny"
And I have a long string of jumbled words (that include a few instances of the words listed in the array such as: string = "jkmakespohbatsllfunnythisqwemakes"
String contains two instances of the word "makes", one instance of "bats", one instance of "funny", one instance of "this" and zero instances of "look".
Can someone please help point me in the right direction with some pseudo-code on how I would search the string for any substring words from my array and print the count of each instance found (as noted above) or not found.
I am in different on programming language right now but would probably want to code this later when I have a better grasp of the structure.
Thanks!
forloop, and to know that strings have acountmethod, so thatmyvar.count("makes")will return a number.for word in myArray: print(longstring.count(word))maybe?