完成第一题

master
anyin233 5 years ago
commit 8ed8f0af48

@ -0,0 +1,15 @@
import random
words_list = ['sdf', 'asd', 'fds', 'zxc', 'fasd', 'wef', 'few', 'ewfd', 'gsg', 'fefs', 'fxce']
aList = [random.choice(words_list) for _ in range(1000)]
b_dict = dict()
for w in aList:
b_dict[w] = b_dict.get(w, 0) + 1
for k, v in b_dict.items():
print("{}:{} times".format(k, v))
Loading…
Cancel
Save