Question: Basic Intro Computer science we are to define a function change(s) will take all the capitalized characters in the string adn make them lowercase and

Basic Intro Computer science
we are to define a function change(s)
will take all the capitalized characters in the string adn make them lowercase and upper case.
This is what I tried to do... nad no output is being printed.PLZ HELP
def change(s): new_string = '' uppers = s.upper() lowers = s.lower() for characters in s: if uppers in characters: n = s.lower(uppers) new_string = s.replace(uppers, n ) elif lowers in characters: n = s.upper(lowers) new_string = s.replace(lowers, n ) return new_string sx = 'HeY GURL WHATHUFI f ffff ' sxx = change(sx) print(sxx)
3. (11 points) Develop module qe3.py. The module defines a single function change). Function change() has a single string parameter s.)The function returns 2new string equal to s except the case of all letters is switched (e.g., 'e' becomes E' and vice-versa). For ex segment- ,the following code toPS Act 1' yq03.change( x ); yq03.change( x); y qo3.change( x ) print( y print( y) print( y) should produce output Saw Tops aCT 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
