Created
June 30, 2014 11:11
-
-
Save samarthbhargav/bbd9200b83e9ac3f3704 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyList(list): | |
def find(self, element): | |
if element in self: | |
return self.index(element) | |
else: | |
return -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment