lower(): all lower case letters.

my_str='Welcome to Plus2net'
output=my_str.lower()
print(output)                # welcome to plus2net

my_str='WELCOME TO PLUS2NET'
output=my_str.lower()
print(output)                # welcome to plus2net

my_str='welcome to plus2net'
output=my_str.lower()
print(output)                # welcome to plus2net

Handling Strings with Special Characters

When applying lower() to strings with numbers or special characters, only alphabetic characters are affected:

my_str = "Hello123!@#"
print(my_str.lower())  # Output: "hello123!@#"

Use Case: Normalizing User Input

When comparing user inputs, converting strings to lowercase ensures case-insensitive comparisons:

input_str = "Yes"
if input_str.lower() == 'yes':
    print("Input accepted.")
output
Input accepted.
All String methods upper() islower() isupper()


Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com







Python Video Tutorials
Python SQLite Video Tutorials
Python MySQL Video Tutorials
Python Tkinter Video Tutorials
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer