pyassistant

First and Last Character Swap

Given a list of strings, return a new list where all the strings of the original list have been changed to a new string. The new string is formed by swapping the first and last characters of the original string.

Example:

Input:
['hello', 'world', 'coding', 'challenge']
Output:
['oellh', 'dorld', 'goding', 'ehallengc']

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.