Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Del Keyword | Dictionary
course content

Зміст курсу

Python Data Structures

Del KeywordDel Keyword

In a dictionary, you can remove keys using the del keyword. With it, you can delete specific entries or even the entire dictionary. Here's how you can do it:

Завдання

Consider this dictionary:

{'country_1': 'India', 'country_2': 'Latvia', 'country_3': 'Panama', 'country_4': 'Serbia'}

Your goal is to modify it to look like this:

{'country_2': 'Latvia', 'country_3': 'Panama'}

Все було зрозуміло?

Секція 2. Розділ 5
toggle bottom row
course content

Зміст курсу

Python Data Structures

Del KeywordDel Keyword

In a dictionary, you can remove keys using the del keyword. With it, you can delete specific entries or even the entire dictionary. Here's how you can do it:

Завдання

Consider this dictionary:

{'country_1': 'India', 'country_2': 'Latvia', 'country_3': 'Panama', 'country_4': 'Serbia'}

Your goal is to modify it to look like this:

{'country_2': 'Latvia', 'country_3': 'Panama'}

Все було зрозуміло?

Секція 2. Розділ 5
toggle bottom row
some-alt