capital letter to small letter python code example
Example 1: python lowercase
// turn to lower/upper
string = string.upper()
string = string.lower()
// check if all letter are lower or upper
string.islower()
string.isupper()
Example 2: capitalize string python
string = "this isn't a #Standard Sntence."
string.capitalize()
string.upper()
string.lower()
string.title()
from string import capwords
string = capwords(string)
string = " ".join(s.capitalize() for s in string.split())
Example 3: converting capital letters to lowercase and viceversa in python
s=input()
new_str=""
for i in range (len(s)):
if s[i].isupper():
new_str+=s[i].lower()
elif s[i].islower():
new_str+=s[i].upper()
else:
new_str+=s[i]
print(new_str)