From 110d3180fef8abddf22276f601cab0b3485ff33b Mon Sep 17 00:00:00 2001 From: Mukesh Jha Date: Mon, 21 Oct 2019 14:59:21 +0530 Subject: [PATCH] Create DataStructure-Dictionary --- DataStructure-Dictionary | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 DataStructure-Dictionary diff --git a/DataStructure-Dictionary b/DataStructure-Dictionary new file mode 100644 index 0000000..3262d59 --- /dev/null +++ b/DataStructure-Dictionary @@ -0,0 +1,11 @@ +#The dictionary is basically key and value pair in python. +a={1:"India",2:"Australia",3:"USA"} +#Here in a 1,2,3 are key while India,Australia and USA are values. +print(a[1]) #Prints India +#The key must be unique while values may even contain a list of other values. +#Ex: +a={1:["India","Australia","USA"],2:["Pakistan","Spain","Italy"] +print(a[1][2])#Prints USA +#The datatype of key and value can be anything as long as key is unique. + +