Write a python program that takes a string as an input from the user and then modifies the string in such a way that the string always starts with an uppercase letter and the case of each subsequent letter is the opposite of the previous letter (uppercase character followed by a lowercase character followed by an uppercase character and so on). Finally the modified string is printed to show the user.
input1 = input('')
string = ''
for i in range(len(input1)):
if i % 2 == 0:
string + input1[i].upper()
else:
string + input[i].lower()
Comments
Leave a comment