0
代码:不支持的操作数类型(一个或多个)为+: 'NoneType' 和 'STR' 和 'INT'
String1 = " Is right"
g = lambda x: x ** 2
print(g(8)) + str(String1)
错误:
Traceback (most recent call last):
File "C:/Users/Computer/Desktop/Testing.py", line 3, in <module>
print(g(8)) + str(String1)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
代码2: 我尝试添加这个:
g = lambda x: x ** 2 + " Should be right!"
print(g(8))
错误:
Traceback (most recent call last):
File "C:/Users/Computer/Desktop/Testing.py", line 2, in <module>
print(g(8))
File "C:/Users/Computer/Desktop/Testing.py", line 1, in <lambda>
g = lambda x: x ** 2 + " Should be right!"
TypeError: unsupported operand type(s) for +: 'int' and 'str'
我INT尝试过了,STR,但它仍然有问题?
而且固定时,请说明固定的代码是如何工作:)我不想只是复制固网