0
How can I print value of var n if one of the argument of constructor of a class and var name is same but different values ?
class FirstClass: n = 9 def __init__(self,n): n = n // 4 self.n = n a = FirstClass(8) print(a.n) # >>> 2 #How can I output 9 for variable n and 2 for an argument in the constructor ?
1 Réponse
0
Kuba Siekierzyński Help me out on this problem.