Question: 1 Use slicing ( Special Topic after Section 6 . 2 ) or other code to do the following tasks. You can test the code

1 Use slicing (Special Topic after Section 6.2) or other code to do the following tasks. You can test the code on any string inputs you want and print out the result but they should work on any input and you should construct a string with all described elements (you can't just output a bunch of things using print()- build a new string!).
a Given an input string, create a new string with the first and last characters removed. For example, if the input is "Gobbo", the new string would contain "obb".
b Given an input string, create a new string with every even-indexed character. For example, if the input is "Gobbo", the new string would contain "Gbo" (zero is even).
c Given an input string, create a new string that is the input string in reverse, skipping the last character. For example, input "Gobbo" creates a new string storing "bboG".
What

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!