小编pra*_*ble的帖子

如何计算学生在 >25th percentile <75th percentile 之间的分数,按分数的递增顺序。使用下面的函数

Students=['student1','student2','student3','student4','student5','student6','student7','student8','student9','student10'] 
Marks = [45, 78, 12, 14, 48, 43, 47, 98, 35, 80]


def display_dash_board(students, marks):

    dictionary = dict(zip(Students,Marks))

    # write code for computing top top 5 students
    print("Top 5 Students are :\n\n")
    for key, value in sorted(dictionary.items(), key=lambda item: item[1],reverse=True)[:5]:
          print("%s: %s" % (key, value))

    # write code for computing top least 5 students
    print("\n\n Top Least 5 Students are : \n\n")
    for key, value in sorted(dictionary.items(), key=lambda item: item[1])[:5]:
          print("%s: %s" % (key, value))    

    # write code for …
Run Code Online (Sandbox Code Playgroud)

python

3
推荐指数
1
解决办法
777
查看次数

标签 统计

python ×1