Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Develop code

EasyMediumHard
123456789101112
Question 8

Alistair is the tournament director for an esports league.

He manages a group of competitive gamers and wants a program to analyse the performance of players over a series of rounds.

Starter Code / Dataset:

# Test data containing players, their names, and scores across 4 rounds
players = [
    {"firstName": "Alex", "lastName": "Chen", "scores": [120, 150, 90, 200]},
    {"firstName": "Bianca", "lastName": "Silva", "scores": [80, 110, 130, 95]},
    {"firstName": "Charlie", "lastName": "Patel", "scores": [210, 190, 220, 180]},
    {"firstName": "Diana", "lastName": "Gomez", "scores": [150, 160, 170, 140]}
]

Write a program to:

  • Calculate and display the total scores made by each player (along with their first name and last name).
  • Calculate and display the grand total score of all players combined.
  • Identify and display the first name, last name, and total score of the two players with the highest total scores. (You may assume there will be no ties for the top two positions).

Your program must function correctly even if more players are added or if the number of rounds (scores) per player changes.

[20]

Develop code Questions

  1. IGCSE
  2. /Computer Science
  3. /Develop code