diff --git a/exercise/dictionary.py b/exercise/dictionary.py index 0fe7ec6..9bb7f4d 100644 --- a/exercise/dictionary.py +++ b/exercise/dictionary.py @@ -1,10 +1,15 @@ +#Creating Dictionery myword = {"centos": "Open source server distribution.", "ubuntu": "Open source desktop distribution", "redhat": "Propriatory OS.", "arch": "Open Source desktop and client distribution." } +#Printing all keys of dictionery print(myword.keys()) print("Check Keys name from above line.") print("Enter your choice name:", end='') +#take input from user to print element of dictionery. tia1 = input() -print(myword[tia1]) \ No newline at end of file +#use of get functio to access element of dictionery. +print(myword.get(tia1,"No Such Key exist in dictionery")) +#print(myword[tia1])