完成第三题

master
anyin233 5 years ago
parent fa2c8da900
commit 5cb897276e

@ -0,0 +1,14 @@
import string
import random
import pprint
x = string.ascii_letters + string.digits
y = [["".join([random.choice(x) for _ in range(random.randint(1, 100))]) for _ in range(random.randint(1, 10))] for _ in range(50)]
def sort_ll(item):
item.sort(key = lambda x: len(x), reverse=True)
return len(item)
y.sort(key=sort_ll, reverse=True)
pprint.pprint(y)
Loading…
Cancel
Save