Question: String user _ entry is read from input with leading and trailing whitespaces. Remove any leading and trailing whitespaces in the string. If user _

String user_entry is read from input with leading and trailing whitespaces. Remove any leading and trailing whitespaces in the string. If user_entry contains the string 'Class:', capitalize all the characters in user_entry. Otherwise, lowercase all the characters in user_entry. Finally, print out the resulting string.
Click here for examples
Ex 1: If the input is:
Class: Microbiology
then the output is:
CLASS: MICROBIOLOGY
Ex 2: If the input is:
Creative writing
then the output is:
creative writing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!