同学成绩

import random


def student():
    lst = []

    for i in range(1, 80):
        lst.append({'00' + str(i): random.randint(10, 100)})

    return lst


def explain(lst):
    if len(lst) > 0:
        for o in lst:
            name, age = o.popitem()
            print('name is %s, age is %s.'%(name, age))
    else:
        print('               ')
print(explain(student()))

你可能感兴趣的:(同学成绩)