def findMoney (word): idx = word.find("$") if idx == -1: return len(word) return idx def findMoney2 (word): for ch in word: if ch == "$": return word.index(ch) # this return will break the loop # thus we will return index of the first # matching symbol return len(word) def findMoney3 (word): for i in range (len(word)): if word[i] == "$": return i return len(word) def ridOfMoney(word): idx = findMoney(word) # what happened if there are no "$" firstHalf = word[:idx]# in the word. Do we need a if statement secondHalf = word[idx+1:] # to catch that? newWord = firstHalf + secondHalf return newWord