Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def same_structure_as(original, other):
- print(original, other)
- if type(original) == type(other):
- try:
- for i in range(len(original)):
- if isinstance(original[i], list) and isinstance(other[i], list):
- return same_structure_as(original[i], other[i])
- elif not isinstance(original[i], list) and not isinstance(other[i], list):
- pass
- else:
- return False
- except IndexError:
- return False
- else:
- return False
- return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement