You can do that with name.swapcase()
. Look up the string methods (or see the older docs for legacy Python 2).
More Related Contents:
- Pandas: Adding new column to dataframe which is a copy of the index column
- Play a Sound with Python [duplicate]
- Non-alphanumeric list order from os.listdir()
- How do I disable log messages from the Requests library?
- DLL load failed error when importing cv2
- How to test the membership of multiple values in a list?
- Python strftime – date without leading 0?
- How to write to a file, using the logging Python module?
- Log output of multiprocessing.Process
- In Python, how can I put a thread to sleep until a specific time?
- How to get Windows’ special folders for currently logged-in user?
- Making an API call in Python with an API that requires a bearer token
- Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries
- How to set the timezone in Django
- Precision lost while using read_csv in pandas
- Pass extra arguments to Serializer Class in Django Rest Framework
- Python: Removing spaces from list objects [duplicate]
- Python: Write unittest for console print
- PyQt5: How to install/run Qt Designer
- openpyxl – adjust column width size
- Can’t install PIL after Mac OS X 10.9
- Where does flask look for image files?
- Datetime conversion – How to extract the inferred format?
- How to get rows which match a list of 3-tuples conditions with SQLAlchemy
- What are good rules of thumb for Python imports?
- How to store and retrieve a dictionary with redis
- Keras give input to intermediate layer and get final output
- List files on SFTP server matching wildcard in Python using Paramiko
- Get data from Twitter using Tweepy and store in csv file
- How do I add a kernel on a remote machine in IPython (Jupyter) Notebook?