
问题中的ls1和ls2如何加减成为新的列表?直接加减的话不行
# 创建两个列表
lst1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
lst2 = [3, 5, 1, 7, 8, 2, 9, 4, 6, 0]
# 将元素两两相加并存储在lst1中
lst1 = [x + y for x, y in zip(lst1, lst2)]
# 将元素两两相减并存储在lst2中
lst2 = [x - y -y for x, y in zip(lst1, lst2)]
# 输出结果
print("lst1:", lst1)
print("lst2:", lst2)