python program to switch first and second characters in a string

Solutions on MaxInterview for python program to switch first and second characters in a string by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "python program to switch first and second characters in a string"
Debora
17 Aug 2016
1str = input("Enter a string : ")
2new_str = str[-1:] + str[1:-1] + str[:1]
3print(new_str)