xxxxxxxxxx
arr = ["apple", "banana", "orange", "kiwi"]
# Swap first and last characters of each string
for i in range(len(arr)):
if len(arr[i]) > 1: # Check if the string has at least 2 characters
arr[i] = arr[i][-1] + arr[i][1:-1] + arr[i][0]
print(arr) # Output: ['eappl', 'aananb', 'eorang', 'iwiik']