In this program, we will take a string as input and swap the last character of a string
Steps to solve the program
- Take a string as input.
- Swap the last character of a string using Indexing.
- Print the output.
#input string
string = "SqaTool"
#Printing output
print(string[-1]+string[1:-1]+string[0])
Output :
lqaTooS