swap_case(s) that flips every uppercase letter in s to lowercase and every lowercase letter to uppercase, leaving digits, punctuation and spaces untouched.s = 'Hello World'
'hELLO wORLD'
Each cased letter flips; the space is unaffected.
s = 'Py3.12 Rocks!'
'pY3.12 rOCKS!'
Digits and punctuation pass through unchanged.
Python strings have a built-in method for exactly this.
Check `str.swapcase()`.