【发布时间】:2020-06-08 21:52:27
【问题描述】:
我在使用构造函数中的值时遇到问题。我正在为我的模糊逻辑传递三个(输入)值,由于某种原因我无法使用。我收到一条错误消息:name 'self' is not defined。
我不知道我做错了什么,因为我的代码中有一个类似的类并且工作正常?这只是我的代码的一个简单版本:
class FirstFuzzy:
def __init__(self, length, arr, dep):
self.veh_que = length
self.veh_arr = arr
self.veh_dep = dep
print(self.veh_que)
【问题讨论】:
标签: python-3.x methods constructor self