How can I invert (swap) the case of each letter in a string?

You can do that with name.swapcase(). Look up the string methods (or see the older docs for legacy Python 2).

Leave a Comment