From 5b98ac36c4d171bf66d2fa363e3789e69473bfa4 Mon Sep 17 00:00:00 2001 From: DHRUV NIVATIA <41631069+DHRUV536@users.noreply.github.com> Date: Thu, 1 Oct 2020 17:29:27 +0530 Subject: [PATCH] Added comments in code for readability --- Dictionary.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Dictionary.py b/Dictionary.py index 026ded0..9212e6a 100644 --- a/Dictionary.py +++ b/Dictionary.py @@ -2,15 +2,27 @@ def main(): - #Student={'Name':"hussein alrubaye",'Age':27,'Slary':232.5}; - Student=dict(Name="hussein alrubaye",Age=27,Slary=232.5); + + + #Student={'Name':"hussein alrubaye",'Age':27,'Salary':232.5}; + + Student=dict(Name="hussein alrubaye",Age=27,Salary=232.5); + # 'Name','Age','Salary' are keys and "hussein alrubaye",27,232.5 are their respective values + + # We can access value from key like this Student['Name']="Hussein Ahmed" + + # Creating a New key in Student Student["Dept"]="software engineer" print(Student,type(Student)) + + # Deleting reference of 'Dept' Key del Student["Dept"] print(Student,type(Student)) print(Student['Name']) print(Student['Age']) + + # Clearing All dictionary Student.clear() print(Student,type(Student))