# 示例列表
names = ["Alice", "Bob", "Charlie"]
ages = [25, 30, 35]
# 使用zip并行迭代
for name, age in zip(names..., ages):
print(f"{name} is {age} years old")
输出:
Alice is 25 years old
Bob is 30 years old
Charlie...# 示例列表
students = ["Alice", "Bob", "Charlie"]
scores = [85, 90, 78]
# 使用enumerate和zip获取索引、姓名和分数
for...# 示例数据
raw_data = [
["Alice", "Math", 85],
["Bob", "English", 90],
["Charlie", "Science",...# 示例嵌套列表
data = [
["Alice", [85, 90, 88]],
["Bob", [78, 82, 84]],
["Charlie", [92, 95, 93