Python Program to input any string and make it the encrypt code by 2 charactern
s= input ('Enter a string')
x=''
len = len(string)
for i in range (len):
ch = string[i]
if (ch=='y'):
x=x+'a'
elif (ch=='z'):
x=x+'b'
elif (ch=='Y'):
x=x+'A'
elif (ch=='Z'):
x=x+'B'
else :
a = ord(ch) + 2
x=x+ chr(a)
print ('String after encrption: ', x)
Comments
Post a Comment