From 4b7b45d4811648ee1822c6c89d9ac0e72505eb03 Mon Sep 17 00:00:00 2001 From: Joe <127773439+joegeorge022@users.noreply.github.com> Date: Fri, 20 Dec 2024 21:17:43 +0530 Subject: [PATCH] Create joe_g.py --- Day-22/joe_g.py | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Day-22/joe_g.py diff --git a/Day-22/joe_g.py b/Day-22/joe_g.py new file mode 100644 index 0000000..d0f702d --- /dev/null +++ b/Day-22/joe_g.py @@ -0,0 +1,52 @@ + +dict1 = { + "name":"Joe", + "status":"alive", + "age":18, + "profession":"engineer", + "location":"Kottayam" +} + +print(dict1) +print(dict1.keys()) +print(dict1.values()) +print(dict1.items()) + +dict2 = { + "name":"Better Joe", + "status":"alive", + "age":24, + "profession":"asset manager", + "location":"New York" +} + +dict1.update(dict2) +print(dict1) + +dict3 = { + "name":"Happy Joe", + "status":"alive", + "age":40, + "profession":"retired", + "location":"Switzerland" +} + + +dict3.pop("age") +print(dict3) + + +dict1.clear() +dict2.clear() + +print(dict2,dict1) + +dict4 = { + "name":"Joe", + "age":41, + "status":"dead", + "profession":"none", + "location":"unknown" +} + +print(dict4)