Created
November 11, 2013 02:41
-
-
Save newbiethetest/7406931 to your computer and use it in GitHub Desktop.
This file contains 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 GetResult: | |
def __init__(self): | |
self.result=[] #here i have changed | |
def add(self,x,y): | |
z= x+y | |
self.result.append(z) | |
rs=GetResult() | |
rs.add(1,2) #the result is [3] | |
print rs.result | |
rs.add(3,4)#the result is [3, 7] #what i want the is [7] !!!!!! | |
print rs.result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment