Answer to Question #243785 in Python for Rishi

Question #243785
Give two strings write a program to determine if a string S2 is a rotation of another string S2
1
Expert's answer
2021-09-28T11:42:39-0400
def is_rotation(s1, s2):
    return s1 in s2 * 2 and len(s1) == len(s2)

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