У меня проблема со строками 14 и 15
Я пытался создать объект с классом по имени "Person", но когда я запускаю скрипт, он говорит мне AttributeError
class Person:
def __init__(self, name, weight, complexion, hobby):
self.name = name
self.weight = weight
self.complexion = complexion
self.hobby = hobby
def introduce_self(self):
print("My name is" ,self.name, self.weight , "in weight," ,self.complexion,"in complexion," , "and I do" ,self.hobby, "for relaxation")
p1 = ("Shereden", 30, "fair", "watching Cumcumbagyea")
p2 = ("Stephen", 40, "dark", "surfing the net")
p1.introduce_self()
p2.introduce_self()
Traceback (most recent call last):
File "C:/Users/HP/PycharmProjects/Opeemu/Hello_world.py", line 14, in <module>
p1.introduce_self()
AttributeError: 'set' object has no attribute 'introduce_self'