What is pythonic best practice for allowing one function to use another function\'s returned values? e.g. Is it better to call one function within another, or better that functi
I would argue that get_values
is not a vital part of adding and should thus be a separate function. If it should be I would say:
class adding:
def get_values(self):
self.x = input("input x")
self.y = input("input y")
self.z = input("input z")
def use_values(self):
print self.x+self.y+self.z
if name == 'main':
dave = adding()
dave.get_values()
dave.use_values()
is a more sound solution.