a = list("abcde") b = list("cdeab") for i in range(len(a)): a = a[1:] + a[:1] if a == b: print("True") break else: print("False")
To embed this project on your website, copy the following code and paste it into your website's HTML: