Dictionary Task 1
Dictionary Task 1
You can:
Update marks
Add subject
Delete grade
Task-2
students = [
"roll_no": 101,
"marks": 89,
"grade": "A"
},
"roll_no": 102,
"marks": 76,
"grade": "B"
},
"roll_no": 103,
"marks": 94,
"grade": "A+"
}
✅ Questions:
3. Update the marks of the third student to 96 and print the updated record.
8. Convert the first student dictionary into a list of keys and print it.
9. Convert the first student dictionary into a list of values and print it.
10. Clear all data of the third student and print the result.
Task-3:
students = {
101: {
"marks": 89,
"grade": "A"
},
102: {
"marks": 76,
"grade": "B"
},
103: {
"marks": 94,
"grade": "A+"
1. Print the name and grade of the student with roll number 102.
2. Update the marks of the student with roll number 103 to 96.
3. Add a new key "subject" with value "Python" to the student with roll number 101.
5. Add a new student with roll number 104, name "Meena Reddy", marks 88, and
grade "A".