Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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 convert string to uppercase, lowercase and how to swapcase 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

how to convert lower case to upper case in python

a = "Hello, World!"
print(a.upper())
#output: HELLO, WORLD!
Comment

PREVIOUS NEXT
Code Example
Python :: server localhost for shar file 
Python :: python dependency injection 
Python :: knn compute_distances_no_loop 
Python :: parameter name in string 
Python :: SQL Query results in tkinter 
Python :: lda from scratch implementation on iris python 
Python :: python how do I count the time that it takes for the sorting to execute in seconds? [closed] 
Python :: list average python recursion 
Python :: loop regex 
Python :: how to make a yes or no question in python 
Python :: decoding to str: need a bytes-like object, list found 
Python :: Permission error 
Python :: How to secure an endpoint for selected users with Flask-JWT-Extended 
Python :: Not getting values from Select Fields with jQuery 
Python :: Express + Jade : Ensuring url paths are correct via controllers, orphaned links 
Python :: EDA dataframe missing and zero values 
Python :: pandas maxima and minima for given column 
Python :: ring open another file 
Python :: ring check if a Ring function is defined or not 
Python :: ring create an application to ask the user about his/her name. 
Python :: ret, img_frame = cap.read() 
Python :: How to make exit button? 
Python :: Python 2.7 to 3.x Linux 
Python :: foreign key on delete arguments 
Python :: gensim wordvector vocabulary list 
Python :: KMeans 
Python :: python colorama 
Python :: get list of all document in django-elasticsearch-dsl 
Python :: for c in range python 
Python :: send command dynamo civid 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =