Answers for "python program to switch first and second characters in a string"

0

python program to switch first and second characters in a string

str = input("Enter a string : ")
new_str = str[-1:] + str[1:-1] + str[:1]
print(new_str)
Posted by: Guest on May-31-2021

Code answers related to "python program to switch first and second characters in a string"

Python Answers by Framework

Browse Popular Code Answers by Language