我有一个具有三个具有不同属性的函数的类:
class Weather:
def __init__(year,month,day):
#do something with year, month and day
def crops(beans,wheat):
#do something with beans and wheat
def vegetables(tomato,garlic)
#do something with tomato, garlic and beans
我需要beans
在两者中使用crops
,vegatables
但 bean 是crops
. 这是可能的还是我需要包含beans
在内__init__
才能在多个功能中使用它?