given two strings a and b a shift on a consists of taking string a and moving the leftmost character to the rightmost position for example if a abcde then it will be bcdea after one shift on a return true if and only if a can become b after some number of shifts on a type a str type b str rtype bool test given two strings a and b a shift on a consists of taking string a and moving the leftmost character to the rightmost position for example if a abcde then it will be bcdea after one shift on a return true if and only if a can become b after some number of shifts on a type a str type b str rtype bool test
def is_rotate_string(A, B):
    
    len_a = len(A)
    len_b = len(B)
    if len_a != len_b:
        return False
    if len_a == 0:
        return True
    for i in range(len_a):
        A = A[-1:] + A[:-1]
        if A == B:
            return True
    return False



print(is_rotate_string('abcde', 'cdeab'))
print(is_rotate_string('abcde', 'abced'))