python39讲,类和对象,拾遗
按照小甲鱼的步骤运行pool = Pool (1,10),再运行pool.Print_num(),到了pool.Print_num()这里运行报错是:
ValueError: unsupported format character '?' (0x6761) at index 15
小白,不理解,求助
class Turtle:
def __init__(self,x):
self.num = x
class Fish:
def __init__(self,x):
self.num = x
class Pool:
def __init__(self,x,y):
self.turtle = Turtle(x)
self.fish = Fish(y)
def Print_num(self):
print('水池里总共有乌龟%d只,小鱼%条'% (self.turtle.num,self.fish.num))
页:
[1]