+ 1
Why print statement in __init__ not executing first?
class A: def __init__(self,a): self.a=a print("in init") print("in A") o=A(30) o/p. In A In init
5 Antworten
+ 4
Because print("in A") comes before you instantiated the class. Though you indented it under the class doesn't mean it has something to do with class, it's a statement on it's own.
+ 3
You're Welcome.
+ 2
hannah simth, I'm thinking you've used the search feature and you've found an answer right?
You're Welcome.
0
Thank you
0
thanks you