This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mutation(arr) { | |
firstWord = arr[0].toLowerCase(); | |
secondWord = arr[1].toLowerCase().slice(''); | |
lettersFound = 0; | |
for(i=0; i<secondWord.length; i++){ | |
indexSearch = secondWord[i]; | |
indexSearchResult = firstWord.indexOf(indexSearch, 0); | |
if(indexSearchResult == -1) { | |
return false; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to test this , create a file called poem.txt in the same folder as this python file | |
# make sure there are a lot of "more" in the poem.txt like | |
poem = """there is more to the world | |
than Demi Moore and Roger Mooore | |
It is a good Morning, but more so | |
a good day to every moron out there, | |
gimme more, more, moreofit""" | |
# i assume you are using python3.2 here | |
# open file as fileoobject f |