我不明白为什么我的代码输出 无 ?
class mobile:
def __init__(self, name, brand):
self.name = name
self.brand = brand
# def get_name(self):
# return self.name
class cpu(mobile):
def get_name(self):
print(self.name)
brand = cpu("Intel","Sony")
print(brand.get_name())
输出为:
Intel
None