TGViewer
Machinelearning tests Machinelearning tests @machinelearningtest · 661 subscribers
Post #189 655
Дан код и вывод
class A:
def __init__(self, x):
self.x = x
def __call__(self):
return self.x
class B:
def __init__(self, x):
self.x = x
def method(self):
return self.x
class C:
def __init__(self, x=3):
self.x = x
def __repr__(self):
return str(self.x)

a = A(1)
b = B(2)
c = C(3)
callables = # ваш код
print([act() for act in callables])

#Вывод: [1, 2, 3]
More from @machinelearningtest
  1. Apr 16, 2025❓ Что выведет следующий код на Python (модуль statistics)? import statistics as stats impo…
  2. Jul 25, 2024Post #200
  3. Jul 25, 2024Что выведет код? ((lambda x: (lambda y: x ** y)) (3)) (2)
  4. Jul 18, 2024Post #198
  5. Jul 18, 2024Что выведет код? import sys f = lambda x: list(map(sys.stdout.write, x)) t = f(['1', '2',…
  6. Jul 18, 2024Post #196
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →