测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A33351. 执行下列Python程序,最后的输出是( )?lst = [1,2,7,10,15,17,22]result = d =3for i in range(1,len(lst)): if lst[i] - lst[i-1] >d: result +=d else: result lst[i] - lst[i-1]print(result)

单选题 中等

题目描述

执行下列Python程序,最后的输出是(    )?

lst = [1,2,7,10,15,17,22]

result = d =3


for i in range(1,len(lst)):

if lst[i] - lst[i-1] >d:

result +=d

else:

result lst[i] - lst[i-1]

print(result)

选项(单选)

上一题 下一题