Answer to Question #317283 in Python for babu

Question #317283

question:- string encoding


arya has two strings S and T consisting of lower case english letters.

since he loves encoding the strings, he dose the operation below just once on the string S


first, arya thinks of a non- negative integer K then he shifts each character of S to the right

by K


explanation:- 1) in the first example the given strings are S= abc and T= ijk.


when arya chooses K=8

"a" is shifted to the right by 8 and become "i"

"b" is shifted to the right by 8 and become "j"

"c" is shifted to the right by 8 and become "k"


2) in the second example, the given string are S=ppq and T=qqp

there is non-negative integer K that arya can choose to transform S into T so, No should be printed.


input: abc

ijk

output: Yes


input: ppq

qqp

output: No






1
Expert's answer
2022-03-24T10:39:31-0400
list1 = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
string1 = input('')
number = int(input(''))
print(list1[list1.index(string1) + number])

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS