单选题
运行以下Python代码,结果是?( )
class Parent(): def __init__(self, name): self.name = name def greetings(self): print("Parent: Hi, I'm", self.name) class Child(Parent): def greetings(self): super().greetings() print("Child: Hello!")parent = Parent("Alice")child = Child("Bob")chilgreetings()
A.
Parent: Hi, I'm Alice
Child: Hello!
B.
Parent: Hi, I'm Bo
Child: Hello!
C.
Parent: Hi, I'm Bob
D.
Child: Hello!
发表评论 取消回复