PYTHON_TASKS Telegram 2745
Что выведет код?
class A:
__x = 1
def f(self):
return "f from A"

def g(self):
return "g from A"

class B:
__x = 2
def f(self):
return "f from B"

def g(self):
return "g from B"

class C(A, B):
f = B.f

c = C()
print(c.f(), c.g(), c._A__x, c._B__x)



tgoop.com/python_tasks/2745
Create:
Last Update:

Что выведет код?

class A:
__x = 1
def f(self):
return "f from A"

def g(self):
return "g from A"

class B:
__x = 2
def f(self):
return "f from B"

def g(self):
return "g from B"

class C(A, B):
f = B.f

c = C()
print(c.f(), c.g(), c._A__x, c._B__x)

BY Python Tasks & ML | Задачи по питону и машинному обучению


Share with your friend now:
tgoop.com/python_tasks/2745

View MORE
Open in Telegram


Telegram News

Date: |

How to create a business channel on Telegram? (Tutorial) Channel login must contain 5-32 characters According to media reports, the privacy watchdog was considering “blacklisting” some online platforms that have repeatedly posted doxxing information, with sources saying most messages were shared on Telegram. The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers. Click “Save” ;
from us


Telegram Python Tasks & ML | Задачи по питону и машинному обучению
FROM American