def swap_first_last_char(string):
if len(string) <= 1:
return string
swapped_string = string[-1] + string[1:-1] + string[0]
return swapped_string
user_input = input("Enter a string: ")
result = swap_first_last_char(user_input)
print(f"String after swapping the first and last characters: {result}")
#source code --> clcoding.com