Created
October 4, 2018 04:47
-
-
Save shreezan123/57747d630f763332df5ce28ff3215e5d 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 Incrementor: | |
array = [] | |
value = 0 | |
arrayVals = [] | |
def __init__(self,array): | |
self.array = array | |
def add_value(self,value): | |
self.value = value | |
def add_values(self,valuesArr): | |
self.arrayVals = valuesArr | |
def increment_values(self): | |
for i in range(len(self.arrayVals)): | |
self.arrayVals[i] += 1 | |
def get_values(self): | |
return self.arrayVals | |
inc = Incrementor([1,2,3]) | |
inc.add_value(10) | |
inc.add_values([1,2,3,4,5]) | |
inc.increment_values() | |
print inc.get_values() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment