Question: Write a simple program using only string operations ( i . e . , indexing, slicing, and arithmetic ) to create three new strings from

Write a simple program using only string operations (i.e., indexing, slicing, and arithmetic) to create three new strings from an input provided by the user.
The newly created string should have:
1. First and last characters swapped keeping all the other characters as is. The code should ensure that only the first character is in the uppercase if it is an alphabet.\
Ex: if the input is `pullman` the output should be `Nullmap`.
2. Reverse the order of only the characters in the middle leaving the first and last characters as is.\
Ex: if the input is `Pullman` the output should be `Pamllun`.
Use the `input` function to request input from the user. This function takes a string object as an input and outputs a string object containing the text input by the user.\
Usage:
`s = input("...text prompt to the user...")`

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