Sep-22-2016, 03:12 PM
(This post was last modified: Sep-22-2016, 03:18 PM by ujjwalrathod007.)
sorry for that but I take an object of a class xyz as following
in short, I dont know what the function anything() will return.. depending on that I only want to change variables in calculations()
i have done the following changes to the code to execute it properly...
class xyz: def anything(self): if condition: if condition: return something else: return somethingelse elif Condition: return something else: return something def calculations(self): x= something+5 y= somethingelse+10 object1=xyz object1.anything() object1.calculations()it should now take "something" or "somethingelse " depending on the conditions given in multiple if-else loops and do the calculations..
in short, I dont know what the function anything() will return.. depending on that I only want to change variables in calculations()
i have done the following changes to the code to execute it properly...
''' Created on 22 Sep 2016 @author: rathodul ''' something=10 somethingelse=0 a=2 class xyz: def anything(self): if something<somethingelse: if a==10: return something else: return somethingelse elif a>somethingelse: return something else: return something def calculations(self): x= something+5 y= somethingelse+10 return x,y object1=xyz() object1.anything() object1.calculations() print object1.calculations()