fork(1) download
  1. student_ids = ['S001', 'S002', 'S003', 'S004', 'S005', 'S006', 'S007', 'S008', 'S009', 'S010', 'S011', 'S012', 'S013']
  2.  
  3. student_names = ['Camila Rodriguez', 'Juan Cruz', 'Dan Richards', 'Sam Boyle', 'Batista Cesare', 'Francesco Totti', 'Khalid Hussain', 'Ethan Hawke', 'David Bowman', 'James Milner', 'Michael Owen', 'Gary Oldman', 'Tom Hardy']
  4.  
  5. student_grades = [86, 98, 89, 92, 45, 67, 89, 90, 100, 98, 10, 96, 93]
  6.  
  7. res = [{sid:{name:grade}} for sid, name, grade in zip(student_ids, student_names, student_grades)]
  8. print(res)
Success #stdin #stdout 0.02s 8988KB
stdin
Standard input is empty
stdout
[{'S001': {'Camila Rodriguez': 86}}, {'S002': {'Juan Cruz': 98}}, {'S003': {'Dan Richards': 89}}, {'S004': {'Sam Boyle': 92}}, {'S005': {'Batista Cesare': 45}}, {'S006': {'Francesco Totti': 67}}, {'S007': {'Khalid Hussain': 89}}, {'S008': {'Ethan Hawke': 90}}, {'S009': {'David Bowman': 100}}, {'S010': {'James Milner': 98}}, {'S011': {'Michael Owen': 10}}, {'S012': {'Gary Oldman': 96}}, {'S013': {'Tom Hardy': 93}}]