K12教育赛事综合服务平台
专注青少年竞赛题库网站
聚乐之家官方网站
下载聚乐之家官方App
在如下Python代码中,假设变量zen代表很多字符(此处仅为示例),代码实现按小写字母频次升序,如频次相同则按字符ASCII升序输出,横线处应填入:
zen = "Beautiful is better than ugly" alphaCount = {} for c in zen: __________________________ print(sorted(alphaCount.items(), key = lambda x:(x[1], ord(x[0]))))
alphaCount[c]+=1
alphaCount[c.lower()]+=1
alphaCount[c.lower]=alphaCount.get(c.lower,0)+1
alphaCount[c.lower()]=alphaCount.get(c.lower(),0)+1