Blog Archive

search

Tuesday, August 6, 2019

Python program to get a string made of the first 2 and the last 2 chars from a given a string

a = input('Enter a string ': )
if len(a) < 2:
    print('')
print(a[0:2] + a[-2:])

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):...