5. Functions find and replace

1s = "one tiger, two tigers, three tigers"
2print(s.find("tiger"))
3print(s.find("tiger", 4))
4print(s.find("tiger", 16))
5print(s.replace("tiger", "cat"))
6s = s.replace("tiger", "cat")
7print(s)
line that just executed

next line to execute

Print output (drag lower right corner to resize)
Frames
Objects

Activity: CodeLens 5.1 (cl_l18_5_en)

You have attempted 1 of 2 activities on this page