Advertisement
misingnoglic

Untitled

Mar 23rd, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. This is the code I made, and it doesn't pass through the solution even though the outputs looks the same
  2.  
  3.    def intersect(self,other):
  4.        #return [i for i in self.vals if i in other.vals]
  5.        n=intSet()
  6.        for i in self.vals:
  7.            if i in other.vals: n.insert(i)
  8.        return n
  9.  
  10. This code which is modeled after the solution works fine though
  11.  
  12.    def intersect(self,other):
  13.        #return [i for i in self.vals if i in other.vals]
  14.        n=intSet()
  15.        for i in self.vals:
  16.            if other.member(i): n.insert(i)
  17.        return n
  18.  
  19. What's the difference?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement