What is the output of the following code? class A: def __init__(self, x): self.__x = x @property def x(self): return self.__x a = A(7) a.x = 10 print(a.x)

Questions & AnswersCategory: Programming LanguageWhat is the output of the following code? class A: def __init__(self, x): self.__x = x @property def x(self): return self.__x a = A(7) a.x = 10 print(a.x)
Adam asked 2 years ago

What is the output of the following code?

class A:

    def __init__(self, x):

        self.__x = x

    @property

    def x(self):

        return self.__x

a = A(7)

a.x = 10

print(a.x)

 
a.10
b. None
c. AttributeError
d. 7