← IB Computer Science

Records: IB Computer Science practice

Dictionaries and records. 6 questions in the style of the IB Computer Science exam.

Sample questions

What is printed by this code?

student = {"name": "Ana", "age": 15}
print(student["age"])
  1. name
  2. Ana
  3. 15
  4. age

Write a program that reads a whole number n, then n lines in the form `name,score`. Store each line as a record (a dictionary with keys "name" and "score") in a list. Then print `Top: X`, where X is the name of the highest scorer (the first one if there is a tie), and `Average: A`, where A is the mean score rounded to 1 decimal place.