【发布时间】:2022-06-15 22:32:10
【问题描述】:
array = [[1676, 196, 159, 29, 'invoice'], [1857, 198, 108, 28, 'date:']]
width = 159+108 = 267
height = 29+28 = 57
label = invoice date:
Required solution: [1676, 196, 267, 57, 'invoice date:']
有没有办法连接字符串并在同一个列表中添加数字
【问题讨论】:
-
我很困惑,您想将每个列表中的数字相加,但您的解决方案有来自
array[0]的 2 个数字和来自array[1]的 2 个数字 -
使用内置函数
zip
标签: python-3.x