python中的字典生成式

#需求1:假设有20个学生,学生的分数在60~100之间,筛选出成绩在90分以上的学生 import random stuInfo = {} for i in range(20): name = 'westos' + str(i) score = random.randint(60, 100) stuInfo[name] = score print(stuInfo) highscore = {}
相关文章
相关标签/搜索