Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

python
communitycreator

What is swapcase() function in Python?

Mayurika Konduru

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

We have many built-in string methods in python. One such string method is swapcase(), which allows you to convert every lower case letter of a string to upper case letter and vice versa.

Code

s = 'HELLOWORLD'
print(s.swapcase())
s = 'helloworld'
print(s.swapcase())

RELATED TAGS

python
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring