s= input("Enter some string:")
output=''
for x in s:
if x.isalpha():
output=output+x
previous=x
else:
newch=chr(ord(previous)+int(x))
output=output+newch
print(output)
output:
Enter some string:a4b2d9
aebddm
output=''
for x in s:
if x.isalpha():
output=output+x
previous=x
else:
newch=chr(ord(previous)+int(x))
output=output+newch
print(output)
output:
Enter some string:a4b2d9
aebddm
No comments:
Post a Comment