logo

Crowdly

Browser

Add to Chrome

Алгоритмізація та програмування КН

Looking for Алгоритмізація та програмування КН test answers and solutions? Browse our comprehensive collection of verified answers for Алгоритмізація та програмування КН at moodle.mnau.edu.ua.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Як реалізувати перегрузку оператора +?

0%
0%
0%
0%
View this question

Що потрібно вставити замість # ???, щоб створити атрибут класу?

class MyClass:

    # ???

    counter = 0

0%
0%
0%
0%
View this question

Що буде результатом виконання?

class A:

    def __init__(self, x=[]):

        self.x = x

        self.x.append(1)

a1 = A()

a2 = A()

print(a2.x)

0%
0%
0%
100%
View this question

Що буде результатом?

class A:

    def __eq__(self, other):

        return True

print(A() == A())

100%
0%
0%
0%
View this question

Що потрібно вставити, щоб метод bar викликав метод foo суперкласу?

class Parent:

    def foo(self):

        return "Parent"

class Child(Parent):

    def bar(self):

        return # ???

c = Child()

print(c.bar())

0%
0%
0%
0%
View this question

Що буде результатом виконання коду?

class A:

    def __init__(self):

        self.value = 5

a = A()

print(hasattr(a, 'value'))

100%
0%
0%
0%
View this question

Що потрібно вставити, щоб виклик len(obj) працював?

class MyClass:

    def __init__(self, data):

        self.data = data

    # ???

0%
0%
100%
0%
View this question

Який з варіантів дозволяє створити клас Singleton, у якому завжди повертається один і той самий екземпляр?

0%
0%
0%
0%
View this question

Який із варіантів правильно реалізує геттер через декоратор?

class MyClass:

    def __init__(self):

        self._value = 42

    # ???

    def value(self):

        return self._value

100%
0%
0%
0%
View this question

Що буде, якщо не передати self у метод класу?

0%
0%
0%
0%
View this question

Want instant access to all verified answers on moodle.mnau.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome