输入的Python:无法摆脱类型错误的:不支持的操作数类型(S)为+: 'NoneType' 和 'NoneType'
[['1','2','3'],['a','b','c'],['6','7','8'],['e','f','g']]
输出应该是:
1, 2, 3 a, b, c 6, 7, 8 e, f, g
代码:
def print_row(los):
print ', '.join(los)
def print_table(los):
lose = []
if los == []:
return
else:
return print_row(los[0]) + print_table(los[1:])
目前:
print_table([['1','2','3'],['a','b','c'],['6','7','8'],['e','f','g']])
给出:
1, 2, 3 a, b, c 6, 7, 8 e, f, g TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
我该如何解决这个问题?
你有什么期望加入两种功能会做什么? –