To convert a string to lowercase in Python, you can use the lower()
method.
Here is an example code snippet:
string = "Hello World"
lowercase_string = string.lower()
print(lowercase_string)
Output:
hello world
In this example, the lower()
method is called on the string
variable, which converts the string to lowercase. The result is then stored in the lowercase_string
variable, which can be printed to verify the transformation.