题库 Python题库 题目列表 运行以下Python代码,结果是?( )class Parent():de...
单选题

运行以下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")

child.greetings()

A.

Parent: Hi, I'm Alice 

Child: Hello!

B.

Parent: Hi, I'm Bob. 

Child: Hello!

C.
Parent: Hi, I'm Bob
D.
Parent: Hi, I'm Bob
题目信息
2023年 9月 选择题
-
正确率
0
评论
56
点击