vote(['G', 'G', 'N', 'G', 'C'])
我想得到这个结果:('G', [1, 3, 0, 1])
g_count = 0
n_count = 0
l_count = 0
c_count = 0
for i in range(len(ballots)):
if ballots[i] == 'G':
g_count += 1
elif ballots[i] =='N':
n_count += 1
elif ballots[i] == 'L':
l_count +=1
else:
c_count += 1
return [n_count,g_count,l_count,c_count]
我如何获得前面的“G”?