小编The*_*ard的帖子

匹配Python中数组的长度

网上有一些示例如何从较长的数组中减去值,使其与较短的数组的长度相匹配(示例)。但是,较长数组中值的顺序会发生变化。有没有办法从较长数组的末尾减去值?

这就是我想要实现的目标:

a = [1, 2, 3, 4, 5]
b = [1, 5, 8, 2, 7, 3, 5, 9, 4, 10]
Run Code Online (Sandbox Code Playgroud)

一些代码

输出:

a = [1, 2, 3, 4, 5]
b = [1, 5, 8, 2, 7]
Run Code Online (Sandbox Code Playgroud)

python arrays comparison

0
推荐指数
1
解决办法
145
查看次数

标签 统计

arrays ×1

comparison ×1

python ×1