Python String lower() Method
The lower() method is a string method that returns a new string with all uppercase characters converted to lowercase. It does not affect any lowercase characters or non-alphabetical characters.
Here are some examples of using the lower() method:
# example 1: convert a string to lowercase
string = "HELLO this IS Btechgeeks"
print(string.lower()) # hello this is btechgeeks
# example 2: convert a string with numbers and symbols to lowercase
string = "GooD MORNING btechgeeks@123 $$#"
print(string.lower()) # good morning btechgeeks@123 $$#
# example 3: convert a string that is already lowercase
string = "i am a string!"
print(string.lower()) # i am a string!
If you have any questions about this code, you can drop a line in comment.
Comments
Post a Comment