Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Transformations:
- def __init__(self, name, arr) -> None:
- self.name = name
- self.arr = list(arr)
- def append(self, item) -> None:
- self.arr.append(item)
- def __sub__(self, other):
- return Transformations(self.name[:6] + other.name[-3:],
- list(map(filter(lambda x: x not in other.arr, self.arr))))
- def __itruediv__(self, n):
- self.arr = self.arr[:n]
- def __lt__(self, other):
- if len(self.arr) != len(other.arr):
- return len(self.arr) < len(other.arr)
- elif sorted(self.arr) != sorted(other.arr):
- return sorted(self.arr) < sorted(other.arr)
- else:
- return self.name < other.name
- def __call__(self, n):
- return tuple(self.arr[:n])
- def __str__(self):
- return self.name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement