What do the following string methods do? • lower • count • replace #Source Code: str1 = "I love My India" # The lower() method returns a string where all
characters are #lower case. # Symbols
and Numbers are ignored. print(str1.lower()) # The count() method returns the number of times a
specified value appears in the string. print(str1.count("I love My India")) # The replace() method replaces a specified phrase
with another #specified phrase. x = str1.replace("India",
"Family") print(x) |
Output: i love my india 1 I love My Family |
What do the following string methods do? • lower • count • replace
Thursday, November 10, 2022
0
Share to other apps