Using the three lists below, create a dictionary as follows and name it students. items in the
Fantastic news! We've Found the answer you've been seeking!
Question:
Using the three lists below, create a dictionary as follows and name it "students".
- items in the ids list are the keys.
- A name from the names list and the corresponding score from the score list together make a value for the dictionary in a list. See the example below.
- # Use these lists
- scores = [13, 17, 9, 15, 8, 14, 16, 12, 13, 15, 14, 9, 10, 12, 13, 7, 12, 15, 9, 17]
- names = ['Liam', 'Olivia', 'Noah', 'Emma', 'Oliver', 'Charlotte', 'Elijah', 'Amelia', 'James', 'Ava', 'William', 'Sophia', 'Benjamin', 'Isabella', 'Lucas', 'Mia', 'Henry', 'Evelyn', 'Theodore', 'Harper']
- ids = ['lia865', 'oli836', 'noa527', 'emm759', 'oli945', 'cha149', 'eli580', 'ame245', 'jam621', 'ava548', 'wil406', 'sop555', 'ben841', 'isa367', 'luc384', 'mia762', 'hen538', 'eve859', 'the876', 'har508']
# Answer should lok like the dictionary below.# students = {'lia865': ['Liam, 13'], 'oli836': ['Olivia', 15],....}
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date: