0
PLEASE HELP ME RESOLVE THIS ERROR
class User: def ___init___(self, user_id, username): self.id = user_id self.username = username self.followers = 0 self.following = 0 def follow(self, user): self.following += 1 user.followers += 1 user_1 = User("007", "gift") user_2 = User("004", "Abrams") user_1.follow(user_2) print(user_1.following) print(user_1.followers) print(user_2.followers) print(user_2.following) #TypeError: User() takes no arguments
3 ответов
+ 3
Gift Claire
You have 3 underscores on either side of your init.
Reducing it to 2 each side makes your code work.
___init___ -> incorrect
__init__ -> correct
+ 3
Ohh thank you. It has worked
+ 2
Rik Wittkopp 👀 like an eagle 👏👏