Google News
logo
Python Program to Convert a string to lower case
In the following example of Python program that demonstrates how to convert a string to lower case using the built-in lower() function :
Program :
# Convert a string to lower case
my_string = "Hello, World!"
lowercase_string = my_string.lower()

print("The lower case string is:", lowercase_string)
Output :
The lower case string is: hello, world!
In this program, we start by assigning the string value `"Hello, World!"` to the variable `my_string`. We then use the `lower()` function to convert `my_string` to lower case, and assign the result to the variable `lowercase_string`.

Finally, we use the `print()` function to print the message "The lower case string is:" followed by the value of `lowercase_string`.

As you can see, the `lower()` function converts all of the characters in the string to lower case.