Blog Archive

search

Tuesday, August 6, 2019

Python program to change a given string to a new string where the first and last chars have been exchanged

a = input('Enter a string ')
c=len(a)
d=a[1:(c-1)]
print(d)
d = a[c-1]+d+a[0]
print(d)

No comments:

Post a Comment

Python program to create a string from two given strings concatenating uncommon characters of the said strings

PROGRAM :  a = input('Enter a string : ') b = input('Enter a string : ') c='' for i in a:     if(i not in b):...