logo

Crowdly

Browser

Add to Chrome

Основи програмування

Looking for Основи програмування test answers and solutions? Browse our comprehensive collection of verified answers for Основи програмування at virt.ldubgd.edu.ua.

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

Твердження: механізм name mangling перейменовує атрибут __attr класу Bar на _Bar__attr.

100%
0%
View this question

Твердження: при агрегації дочірній об'єкт може існувати незалежно від батьківського об'єкта.

0%
100%
View this question

Твердження: блок else у конструкції try/except виконується навіть якщо виникло виключення.

100%
0%
View this question

Твердження: патерн Singleton гарантує, що клас матиме лише один екземпляр протягом усього часу роботи програми.

100%
0%
View this question

Твердження: у Python можна перевірити наявність методу або атрибута в об'єкта за допомогою вбудованої функції hasattr().

0%
100%
View this question

Що виведе наступний код?

class Animal:

def sound(self):

return 1

class Dog(Animal):

def sound(self):

return super().sound() + 1

print(Dog().sound())

View this question

Твердження: наслідування дозволяє дочірньому класу повторно використовувати атрибути та методи батьківського класу без їх повторного визначення.

100%
0%
View this question

Що виведе наступний код?

class X:

def __init__(self):

self.n = 5

class Y(X):

def __init__(self):

super().__init__()

self.n += 3

y = Y()

print(y.n)

View this question

Що виведе наступний код?

class Num:

def __init__(self, v):

self.v = v

def __mul__(self, other):

return Num(self.v * other.v)

n = Num(3) * Num(4)

print(n.v)

View this question

Скільки параметрів (включаючи self) має метод area у наведеному коді?

class Shape:

def area(self, width, height, unit):

return width * height

View this question

Want instant access to all verified answers on virt.ldubgd.edu.ua?

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

Browser

Add to Chrome