google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 What do the following string methods do? • lower • count • replace

What do the following string methods do? • lower • count • replace

0


 

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

 

 



Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top