【发布时间】:2015-03-16 10:37:45
【问题描述】:
因为我发现很难得到
看看:
def mult(a, b):
if b == 0:
return 0
rest = mult(a, b - 1)
value = a + rest
return value
prod = int(input('Enter number: '))
print('The product of', prod, 'x', prod, 'is', mult(prod,prod))
【问题讨论】:
-
你能修正你的格式吗?我怀疑你的
mult函数没有正确缩进。 -
@Andy 好的,我会解决的
标签: python python-3.x python-2.7 jupyter-notebook spyder