Question: def swap _ ends ( message: str ) = > s t r : w Return a new string that is message with
def swapendsmessage: str :
w "Return a new string that is message with the first and last
characters swapped.
Precondition: lenmessage
swapends cat
'tac"
swapends breakfast for dinnerl'
'Ireakfast for dinnerb'
nen
return swapends message: lastchar middle firstchar
return lastchar middle firstchar
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
