【发布时间】:2020-04-15 03:55:26
【问题描述】:
我正在为项目制作一些代码,我想要在测试功能中做的就是我想要打印出来 我输入的每个“list_total[y]”值
输入示例
1 # forget this input for now,
1 # the lines how many input i want to
100, 200 , 300 # i used a map
那么它应该被打印出100, 200 ,300 而是'None'
我的目标是在每个 'list_total[y]' 中绘制最高值,但似乎返回值是 'none'
所以我也收到一条错误消息
'TypeError: 'NoneType' 对象不可迭代'
当我编写代码时
like return print(max(list_total[y]))
这是我在下面制作的代码
T = eval(input(": "))
list_total = []
def test(value):
for x in range(value):
n = eval(input(": "))
for y in range(n):
list_total[y] = list_total.append(list(map(int, input(": ").split())))
return print(list_total[y]) # make sure code is working
test(T)
【问题讨论】:
-
请重新格式化问题。我认为有人的编辑已经在等待您的批准,