python - Object is not callable -


why object not callable? know problem? code in main main.py:

def average_wind(dia):          wind_list=[]          area=klass.windpower(dia)          print(area) 

and code in class:

class windpower(object):     def __init__(self,digit):         self.digit=digit      def calc_area(self,dia):         area=(dia**2*math.pi)/4         return area         windpower = windpower(10) 

klass.windpower object of windpower class, can't instantiate again. think meant call calc_area method?

area = klass.windpower.calc_area(dia) 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -