Question: Write a Python program that would do the following: 1) Prompt the user to enter a string. 2) The program should print the entered string

Write a Python program that would do the following:

1) Prompt the user to enter a string.

2) The program should print the entered string in all lower case letters on the first line.

3) The program should print the entered string in all upper case letters on the second line.

4) The program should extract the first and last characters from the entered string and print the extracted characters in both upper and lower case letters separated by three hyphens (-)  as shown below on the third line. 

5) The program should find and print the length of the entered string on the fourth line.

For example, if the user enters the string  Welcome to HCC  , then the program should produce the following output:

welcome to hcc

WELCOME TO HCC

W---w---C---c

String length: 14

Step by Step Solution

3.53 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This is a complete question and its about writing a Python program which processes strings Here is ... View full answer

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 Programming Questions!