1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] AttributeError after updating attributes of python object [closed]

Discussão em 'Python' iniciado por Stack, Outubro 7, 2024 às 08:52.

  1. Stack

    Stack Membro Participativo

    class Composition:

    def __init__(self,title):
    self.title=title
    self.type=0
    self.tone=''
    self.mode=''
    ...
    self.harp=0
    self.saxophone=0

    def getharp(self):
    return self.harp


    I thought of adding additional attributes to the Composition object, but when I try to run a program with a Composition object, I get an attribute error: Composition object has no attribute harp.

    Continue reading...

Compartilhe esta Página