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

A57430. 运行下面的程序,结果是?( )h=[-2,-1,0,1,2,3]

单选题

题目描述

运行下面的程序,结果是?( )<br/><pre class="brush:python;toolbar:false">h=[-2,-1,0,1,2,3]
n=len(h)
s=0
for&nbsp;i&nbsp;in&nbsp;range(n):
&nbsp;&nbsp;&nbsp;&nbsp;s=s+bool(h[i])&nbsp;&nbsp;&nbsp;
print(s)</pre>

选项(单选)