Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # Challaneg on Facebook in group Python Programming Language
- # https://www.facebook.com/groups/python.programmers/permalink/2136776633006808/
- class MyList:
- def __init__(self, data=None):
- raise NotImplementedError('You have to implement MyList.__init__()')
- def __str__(self):
- raise NotImplementedError('You have to implement MyList.__str__()')
- def __len__(self):
- raise NotImplementedError('You have to implement MyList.__len__()')
- def __getitem__(self, key):
- raise NotImplementedError('You have to implement MyList.__getitem__()')
- def __setitem__(self, key, value):
- raise NotImplementedError('You have to implement MyList.__setitem__()')
- def __in__(self, value):
- raise NotImplementedError('You have to implement MyList.__in__()')
- def __add__(self, value):
- raise NotImplementedError('You have to implement MyList.__add__()')
- def __radd__(self, value):
- raise NotImplementedError('You have to implement MyList.__radd__()')
- def __iter__(self):
- raise NotImplementedError('You have to implement MyList.__iter__()')
- def __next__(self):
- raise NotImplementedError('You have to implement MyList.__next__()')
- def append(self, data):
- raise NotImplementedError('You have to implement MyList.append()')
- def expand(self, data):
- raise NotImplementedError('You have to implement MyList.expand()')
- def contains(self, value):
- raise NotImplementedError('You have to implement MyList.contains()')
- def find(self, value):
- raise NotImplementedError('You have to implement MyList.find()')
- # ----
- #m = MyList() # error: You have to implement MyList.__init__()
- #print(m) # error: You have to implement MyList.__str__()
- #len(m) # error: You have to implement MyList.__len__()
- #m[0] # error: You have to implement MyList.__getitem__()
- #m[0:1] # error: You have to implement MyList.__getitem__()
- #m[0] = 1 # error: You have to implement MyList.__setitem__()
- #m[0] = m[0] + 1 # error: You have to implement MyList.__getitem__() and MyList.__setitem__()
- #for x in m: # error: You have to implement MyList.__iter__() (and MyList.__next__())
- #1 in m # error: You have to implement MyList.__in__()
- #m.append(1) # error: You have to implement MyList.append()
- #m.expand([1,2]) # error: You have to implement MyList.expand()
- #m.contains(1) # error: You have to implement MyList.contain()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement