Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for Monkey Typing by Michal_Adamski98
def count_words(text, words):
d=len(text)
text=text.lower()
licz=0
for word in words:
if word in text.lower():
licz+=1
return licz
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert count_words("How aresjfhdskfhskd you?", C) == 3, "Example"
assert count_words("Bananas, give me bananas!!!", {"banana", "bananas"}) == 2, "BANANAS!"
assert count_words("Lorem ipsum dolor sit amet, consectetuer adipiscing elit.",
{"sum", "hamlet", "infinity", "anything"}) == 1, "Weird text"
print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")
Oct. 21, 2017