StudyRepo_Synergy/part1_basic/lesson8/app.py

21 lines
633 B
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"""
Модуль является результатом выполнения практической
домашней работы по теме "Словари и функции"
:copyright: Сергей Ванюшкин <pi3c@yandex.ru>
:git: https://git.pi3c.ru/pi3c/StudyRepo_Synergy.git
:license: MIT
2023г.
"""
my_dict = {"name": "John", "age": 25, "city": "New York"}
print(my_dict)
my_dict["age"] = 26
my_dict["email"] = "john@example.com"
print(my_dict.get("country", "Нет в словаре ключа 'country'"))
my_dict.pop("city")
for k, v in my_dict.items():
print("ключ:", k, "значение:", v)