Python中for循环两个列表要怎么使用

2025-04-25 11:01:04
推荐回答(1个)
回答1:

for x, y in zip(a, b):
print(f'x={x}, y={y}')

# x=1, y=4

# x=2, y=5

# x=3, y=6

或者