Question: Question 3 : ( 1 5 marks ) Based on the material presented in SS 3 lecture, answer the following question. M 1 1 0

Question 3:(15 marks)
Based on the material presented in SS3 lecture, answer the following question.
M110/ TMA
Page 3 of 42023/2024 Spring
Given two lists, names and grades, containing five names and five corresponding grades, respectively, create a Python program to generate a dictionary.
The dictionary should have five initial records, each representing a student's name and their corresponding grade.
Additionally, the program should prompt the user to enter values for two more pairs, and these should be added to the dictionary using a loop.
Follow the instructions below:
Use the provided lists below:
names =["Ameen", "Bassam", "Kamal", "Abdallah", "Jad"]
grades =[85,92,78,89,95]
Create a dictionary named student_records that includes five initial records, with each pair consisting of a name and a grade from the given lists based on their indices.
Prompt the user to enter values for two additional pairs (name and grade) using a loop.
Add the user-input pairs to the student_records dictionary.
After updating the dictionary, print the final contents of student_records.
Include proper screenshots that include the code and output with a background that shows your desktop.
The expected output should be as follows:
Question 3 : ( 1 5 marks ) Based on the material

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!