If you want to invert the case of that string, try this:
>>> 'AltERNating'.swapcase()
'aLTernATING'
More Related Contents:
- How do I lowercase a string in Python?
- How can I concatenate str and int objects?
- What is the difference between encode/decode?
- Printing without newline (print ‘a’,) prints a space, how to remove?
- write() versus writelines() and concatenated strings
- How to detect lowercase letters in Python?
- How to change a string into uppercase
- Python string to unicode [duplicate]
- Fast string array – Cython
- Finding and counting the frequency of known pairs of words in multiple files [closed]
- Count the number of occurrences of a character in a string
- Split string with multiple delimiters in Python [duplicate]
- Remove empty strings from a list of strings
- Is there a way to convert number words to Integers?
- String formatting in Python
- How to pretty-print a numpy.array without scientific notation and with given precision?
- Case insensitive ‘in’
- Alphabet range in Python
- Using “and” and “or” operator with Python strings [duplicate]
- When splitting an empty string in Python, why does split() return an empty list while split(‘\n’) returns [”]?
- Splitting a string by list of indices
- How can I convert a string to an int in Python?
- Converting a column within pandas dataframe from int to string
- efficiently checking that string consists of one character in Python
- Are strings cached? [duplicate]
- Print very long string completely in pandas dataframe
- Remove duplicate chars using regex?
- Print without b’ prefix for bytes in Python 3
- How to check a string for a special character?
- Python: Best Way to remove duplicate character from string