Python Tasks & ML | Задачи по питону и машинному обучению
رفتن به کانال در Telegram
Algorithms, functions, classes, regular expressions, iterators, generators, OOP, exceptions, NumPy, pandas, scikit-learn https://telega.in/c/python_tasks Questions — @dina_ladnyuk
نمایش بیشتر8 678
مشترکین
-424 ساعت
-77 روز
-5230 روز
آرشیو پست ها
Выберите правильный вариант
Что выведет код?
class Descriptor:
def __get__(self, obj, objtype=None):
return 99
class A:
x = Descriptor()
a = A()
print(a.x)Выберите правильный вариант
Что выведет код?
class A:
__slots__ = ['x']
a = A()
a.x = 10
a.y = 20
print(a.x)Выберите правильный вариант
Что выведет код?
class A:
def __init__(self):
print("A", end='')
class B(A):
pass
b = B()Выберите правильный вариант
Что выведет код?
class A:
def __init__(self, val):
self.val = val
def __eq__(self, other):
return self.val == other.val
a1 = A(3)
a2 = A(3)
print(a1 == a2)Выберите правильный вариант
Что выведет код?
class A:
def __str__(self):
return "Custom str"
a = A()
print(a)Выберите правильный вариант
Что выведет код?
class A:
def __init__(self, value):
self._x = value
@property
def x(self):
return self._x * 2
a = A(5)
print(a.x)Выберите правильный вариант
Что выведет код?
class A:
@staticmethod
def stat():
return "Static"
@classmethod
def cls(cls):
return cls.__name__
def inst(self):
return self.__class__.__name__
a = A()
print(A.stat(), A.cls(), a.inst())Выберите правильный вариант
Что выведет код?
class A:
def hello(self):
return "Hello from A"
class B(A):
def hello(self):
return "Hello from B"
b = B()
print(b.hello())Выберите правильный вариант
Что выведет код?
class A:
def __init__(self):
self.x = 1
a = A()
b = a
b.x = 5
print(a.x)Выберите правильный вариант
اکنون در دسترس! پژوهش تلگرام ۲۰۲۵ — مهمترین بینشهای سال 
