Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python swapcase() method Example

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())
Comment

swapping upper case and lower case string python

# swapcase() method 

string = "thE big BROWN FoX JuMPeD oVEr thE LAZY Dog"
print(string.swapcase()) 

>>> THe BIG brown fOx jUmpEd OveR THe lazy dOG
Comment

How to swapcase of string in python

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
Comment

swap case python

t = "Mr.Brown"
nt = t.swapcase()
print(nt)
Comment

PREVIOUS NEXT
Code Example
Python :: python pip 
Python :: a function to create a null matrix in python 
Python :: lcd of 18 and 21 
Python :: how to get cpu model in python 
Python :: dependency injection python 
Python :: how to convert tensorflow 1.15 model to tflite 
Python :: qr code scanner using opencv 
Python :: python loop array 
Python :: django prevent duplicate entries 
Python :: panda lambda function returns dataframe 
Python :: Python Switch case statement by Dictionary Mapping 
Python :: Python NumPy tile Function Example 
Python :: re.sub 
Python :: if statement python explained 
Python :: Data Structure tree in python 
Python :: python foreach 2d array 
Python :: logger 
Python :: sample hyperparameter tuning with grid search cv 
Python :: explode function in python 
Python :: what does the .item() do in python 
Python :: python tuple example 
Python :: create a colun in pandas using groupby 
Python :: python print not working 
Python :: clear 
Python :: python : a counter 
Python :: python find length of list 
Python :: run pyinstaller from python 
Python :: how to replace a character of a string 
Python :: django model 
Python :: input() function in python 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =