+ 3

Check out my code in Python for feedback

Guys, I have created a code that shows how many times a word occurs in Eminem's "Rap God" https://code.sololearn.com/cghyhs0HF7b0 As Python is case sensitive, I used "lower" method both for the string and the input. Also there are words, that occur in other words, e.g. "talk" and "talking". Currently I want the code to count the word as many times as it occurs in the text. But for other occasions I am curious, how could I make an exact match when searching? Please, let me know if you have other suggestions to improve my code. Thanks in advance!

18th May 2017, 11:42 AM
Hakob Baghdasaryan
Hakob Baghdasaryan - avatar
3 Answers
+ 1
Hi, I made a sample code here on how you can find a specific word, regardless of its case or location. Let me know if this helps. https://code.sololearn.com/cah4G1rZuD8E/?ref=app
19th May 2017, 1:24 PM
Sapphire
0
@Sapphire that is great, thanks a lot! It is a bit complex for me at the moment, but I will cover the parts that you used in your code very soon) And the comments were really helpful!
19th May 2017, 9:02 PM
Hakob Baghdasaryan
Hakob Baghdasaryan - avatar
0
You can always post on here and someone will try and help, if you're confused about something. ^^
19th May 2017, 9:04 PM
Sapphire