Python program to swap the first and the last character of a string