- 3
How would the attribute __a of the class b be accessed from outside the class?
Tell the answer.
34 Antworten
+ 17
_b__a
+ 6
the answer is _b__a
+ 6
answer: _b__a
+ 6
_b__a
+ 5
_b__a
+ 2
_b__a
+ 2
Alternative:
b()._b__a
+ 2
_b__a
+ 2
_b__a
+ 1
Example :
c =b() #New instant of the class b
print(c._b__a) #prints attribute __a of the class b
+ 1
_b__a
+ 1
Ans:
_b__a
+ 1
_b__a
+ 1
How would the attribute __a of the class b be accessed from outside the class?
Answer:- _b__a
0
What is the purpose of prefacing a method name with a single underscore?
Answer :- To mark it as private
0
What is a private method in Python?
Answer :- A method external code is discouraged from using
0
Which tag contains the visual part of the web page?
Answer :- <Body>
0
The ans is _b__a
0
_b_a
0
https://youtu.be/Tg4Du8eUFw8
full python video tutorial link