Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def circularly_identical(list1, list2):
- # doubling list
- list3 = list1 * 2
- # traversal in twice of list1
- for x in range(0, len(list1)):
- z = 0
- # check if list2 == list1 curcularly
- for y in range(x, x + len(list1)):
- if list2[z]== list3[y]:
- z+= 1
- else:
- break
- # if all n elements are same circularly
- if z == len(list1):
- return True
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement