generate functionThu, 17 Nov 2022

Change upper case into lower case and lower case into upper case in a string and print it in case order using without using any functions

string = 'AbCdEfGhIjKlMnOpQrStUvWxYz' new_string = [] for char in string: if char.isupper(): new_string.append(char.lower()) elif char.islower(): new_string.append(char.upper()) else: new_string.append(char) ''.join(new_string)

Questions about programming?Chat with your personal AI assistant