为什么我的代码会多打印一个none出来
# Enter a code
#coding:utf-8
class Animal():
def __init__(self,name,age):
self.name=name
self.__age=age
def get_age(self):
print(self.__age)
print(self.name)
cat=Animal('lili',1)
print(cat.get_age())
# Enter a code
#coding:utf-8
class Animal():
def __init__(self,name,age):
self.name=name
self.__age=age
def get_age(self):
print(self.__age)
print(self.name)
cat=Animal('lili',1)
print(cat.get_age())
2021-10-12
举报