Computer Science, asked by badhonsadia0, 3 months ago

Read into the computer a line of text containing both uppercase and
lowercase letters. Write out the text with the uppercase and lowercase
letters reversed, but all other characters intact.

Answers

Answered by param302004
0

Answer:

Your Answer:

text = input('Enter a line: ')

upper =''

lower = ''

l = len(text)

for i in range((l-1), -1,-1):

if text[i].isupper():

upper+=text[i]

elif text[i].islower():

lower+=text[i]

print('Upper Case characters in Reversed:', upper)

print('Lower Case characters in Reversed:', lower)

Explanation:

text = input('Enter a line: ')

upper =''

lower = ''

l = len(text)

for i in range((l-1), -1,-1):

if text[i].isupper():

upper+=text[i]

elif text[i].islower():

lower+=text[i]

print('Upper Case characters in Reversed:', upper)

print('Lower Case characters in Reversed:', lower)

Similar questions