166k views
2 votes
Choose the correct term to finish the program. When done, the contents of info will be as shown.

{3: 10.4:23, 11:31}

>>> info = {3:10, 4:23, 7:10, 11:31}

>>> info

(7

delete

pop

remove

User Alexvdvalk
by
3.7k points

1 Answer

8 votes

Answer:

The correct term is info.pop(7)

Step-by-step explanation:

Given:

info = {3:10, 4:23, 7:10, 11:31}

Required

Which term removes 7:10 from the dictionary

To remove an item from a dictionary in Python, you follow the syntax below:

[dictionary-name].pop(key)

In this case:

The dictionary name is info and the key is 7

So, the term that implements the syntax is: info.pop(7)

After the instruction info.pop(7) is executed, the content of the dictionary becomes: {3: 10.4:23, 11:31}

User Rghome
by
4.3k points