Q. Create a dictionary 'ODD' of odd numbers between 1 and 10, where the key is the decimal number and the value is the corresponding number in words. Perform the following operations on this dictionary:
(a) Display the keys
(b) Display the values
(c) Display the items
(d) Find the length of the dictionary
(e) Check if 7 is present or not
(f) Check if 2 is present or not
(g) Retrieve the value corresponding to the key 9
(h) Delete the item from the dictionary corresponding to the key 9
Answer =
Let the dictionary name is ‘dic’.
(a) dic.keys()
(b) dic.values()
(c) dic.items()
(d) len( dic )
(e) 7.0 in dic
(f) 2.0 in dic
(g) dic[ 9.0 ]
(h) del dic [ 9.0 ]
Thnx
ReplyDeleteWelcome : )
Deletethnakyou so much
ReplyDeleteThank you
ReplyDeleteWelcome 😊😊
DeleteIt is clearly mentioned that create a dictionary 'ODD'. Then why did the answer used 'dic' as the name of the dictionary.
ReplyDeleteHI PPPPPPPPPPPPPPPPPPPPPPAAAAAAAAAAAAAAAAAAAAATTTTTTTTTTTTTTTTTTTTTTTTTHHHHHHHHHHHHHHHHHHHHHHHH WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
ReplyDeleteThank you
ReplyDeleteThank you
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )