pyassistant

String Swap

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

Example:

Input:
['hello', 'world', 'python']
Output:
['oellh', 'dorld', 'nythop']

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.