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 ie indexing, slicing, and arithmetic to create three new strings from an input provided by the user.
The newly created string should have:
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
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 inputtext prompt to the user..."
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
