Nov-25-2019, 04:22 PM
Why does the following program output "python is hard" ?
class t: def __init__(self): self.__t="python is hard" t=t() print(t._t__t)
strange class property
|
Nov-25-2019, 04:22 PM
Why does the following program output "python is hard" ?
class t: def __init__(self): self.__t="python is hard" t=t() print(t._t__t)
check https://dbader.org/blog/meaning-of-under...-in-python
in particular - part 3. Double Leading Underscore: __var
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link Create MCV example Debug small programs
Nov-25-2019, 04:32 PM
Thanks!
|
|