想要统计数字1在列表number中出现的次数,正确的代码是?
n = 0 for i in range(len(number)): if number[i] == 1: n += 1 print(n)
n = 0 for i in range(len(number)): if i == 1: n += 1 print(n)
n = 0 for i in range(number): if number[i]==1: n+=1 print(n)
n = 0 for i in range(len(number)): n+=1 print(n)