下面程序,按字典序列统计出单词的个数,执行结果如下:
are:2
first:2
happy:1
is:3
your:2
请补全下列代码中的①②③④四处。
a=['is','happy','is','your','are','first','first','is','are','your'] n=len(a)-1 for i in range(0,n): for j in range(i+1,n+1): if a[i]>a[j]: ① key=a[0] i=1 ans=1 while i<=n: if key==a[i]: ② i+=1 else: print(a[i-1]+':'+str(ans)) key=a[i] ③ i+=1 ④