问题遇到的现象和发生背景python idle
问题相关代码,请勿粘贴截图
class User():
def init(self, first_name, last_name, others):
self.first_name = first_name
self.last_name = last_name
self.others = others
self.login_attempts = 0
def describe_user(self):
print("This is the basic information: "
+ self.first_name)
def greet_user(self):
print("Hello, " + self.first_name + self.last_name +
"\nyour information is " + self.others)
def increment_login_attempts(self):
self.login_attempts += 1
return self.login_attempts
def reset_login_attempts(self):
self.login_attempts = 0
U1 = User('Liu', 'Bw','eerdos')
print("Now, the number is " + str(U1.increment_login_attempts()))
U1.increment_login_attempts()
print(self.login_attempts)