求x的平方,输入代码 def power(x): return x * x
运算正常 但是求x的三次方,输入代码
def power(x, n): s = 1 while n > 0: n = n - 1 s = s * x return s 回车后就显示Syntax Error:invalid Syntax 为什么会出现这样的错误?应该怎么修改? Python是 3.6.0 电脑是Windows 7
Sign in to make a reply
再回首-知
求x的平方,输入代码 def power(x): return x * x
def power(x, n): s = 1 while n > 0: n = n - 1 s = s * x return s 回车后就显示Syntax Error:invalid Syntax 为什么会出现这样的错误?应该怎么修改? Python是 3.6.0 电脑是Windows 7