[英]While Trying to def: TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'int'
[英]While trying to def: Type Error: unsupported operand type(s) for ** or pow(): 'NoneType' and 'int'
def linear_equation(a, b):
while True:
x = yield
e = a*(x**2)+b
return e
print('Expression, '+str(a)+'*x^2 + '+str(b)+', with x being '+str(x)+' equals '+str(e))
我收到错误消息:
e = a*(x**2)+b
TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'int'
def linear_equation(a, b):
while True:
x = yield
e = a*(x**2)+b
return e
print('Expression, '+str(a)+'*x^2 + '+str(b)+', with x being '+str(x)+' equals '+str(e))
我收到错误消息:
e = a*(x**2)+b
TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'int'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.