类型转换代码在本地运行总是报错?请问应该如何解决?
print(int(Rational(7, 2)))
TypeError: __init__() takes 1 positional argument but 3 were given
你的__init__()方法参数少写了 应该是p,q没加上
参数问题吧