DS160123 --- Topic about dictionary

Please select all correct ways to empty the following dictionary

student = {
“name”: “Emma”,
“class”: 9,
“marks”: 75
}

  1. del student`

  2. del student[0:2]`

  3. student.clear()`

1 Like

@ritheshchandra1707

Nice,keep it up.

1 Like

option 1 will delete the dictionary not empty it
option 2 involves slicing which is unsupported for dictionary
option 3 will empty the dictionary successfully

2 Likes