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.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question

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.

Hints: Flags/counters can be used to manage uppercase-lowercase.
Sample Input 1:
Python programming is very easy
Sample Output 1:
PyThOn ProgRaMmlnG iS VETY EASY
Sample Input 2:
love
Python
Programming
Sample Output 2:
I IOVE
pYtHON
PROGTAMMING
Sample Input 3:
CSE110 Course
Sample Output 3
CSE110 COURSE
Transcribed Image Text:Hints: Flags/counters can be used to manage uppercase-lowercase. Sample Input 1: Python programming is very easy Sample Output 1: PyThOn ProgRaMmlnG iS VETY EASY Sample Input 2: love Python Programming Sample Output 2: I IOVE pYtHON PROGTAMMING Sample Input 3: CSE110 Course Sample Output 3 CSE110 COURSE
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning