Python swapcase() method Example
text1 = "pYTHON tUTORIALS"
print(text1.swapcase())
text2 = "HELLO WORLD"
print(text2.swapcase())
text3 = "welcome to itsmycode"
print(text3.swapcase())
text4 ="12345!!!"
print(text4.swapcase())
# swapcase() method
string = "thE big BROWN FoX JuMPeD oVEr thE LAZY Dog"
print(string.swapcase())
>>> THe BIG brown fOx jUmpEd OveR THe lazy dOG
s = 'KDnuggets'
print(''KDnuggets' as uppercase: {}'.format(s.upper()))
print(''KDnuggets' as lowercase: {}'.format(s.lower()))
print(''KDnuggets' as swapped case: {}'.format(s.swapcase()))
# Output
# 'KDnuggets' as uppercase: KDNUGGETS
# 'KDnuggets' as lowercase: kdnuggets
# 'KDnuggets' as swapped case: kdNUGGETS
a = "Hello, World!"
print(a.upper())
#output: HELLO, WORLD!