繁体   English   中英

尝试定义时:类型错误:** 或 pow() 不支持的操作数类型:'NoneType' 和 '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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM