...

/

اختبار: البرمجة الكائنية التوجه في Python

اختبار: البرمجة الكائنية التوجه في Python

اختبر ما تعلمته عن البرمجة الموجهة للكائنات باستخدام هذا الاختبار الممتع!

سنغطي ما يلي...
1

What will be the output of the following code?

class Animal:
    def __init__(self, name):
        self.name = name

    def speak(self):
        return "Some sound"

class Dog(Animal):
    def speak(self):
        return "Woof!"

dog = Dog("Buddy")
print(dog.speak())
A)

Some sound

B)

Woof!

C)

Buddy

D)

Error

Question 1 of 60 attempted
...