Using the string methods that we have learned so far, write a program that will allow the user to type in line of text until the user types in the phrase "The end" on a line by itself. The program will replace every occurrence of "is" with the string "was" and count the number of changes made. Strings have two basic methods that you will need for this assignment:
s.find(t)
- which returns the
position where substring t appears in s. If t does not appear in S, it
returns -1. s + t
- which returns a string
consisting of the strings s and t concatenated (or joined)
together.s[i:j]
- which returns a substring of s
beginning at character i and ending at character j-1.s.[i:]
- which returns a substring of s
beginning at character i and ending at the end of s.s.replace(t, u)
- which returns a stringr
with every occurence of t replaced with u