How to return a new string with its first and last characters swapped code example
Example: How to return a new string with its first and last characters swapped
>>> temp = "abcde"
>>> temp[1:-1]
'bcd'
>>> temp[-1:] + temp[1:-1] + temp[:1]
'ebcda'
>>>