第27787题 单选题
关于Python变量迭代操作,下列说法正确的是?

已知如下两段Python代码:

# 代码1
nums = [1, 2, 3, 4]
for num in nums:
    num *= 2
print(nums)

# 代码2
fruits = ["apple", "banana", "cherry"]
for index, fruit in enumerate(fruits):
    fruits[index] = fruit.upper()
print(fruits)

请结合代码判断下列选项的正确性:

{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析