Professional Documents
Culture Documents
Practical No - 5
Practical No - 5
Aim : -
Software used: - Python
Question 2 –
Implementation: -
d1={1:"apple",2:"orange",3:"mango",4:"kiwi",5:"guava"}
print(d1[4])
Output: -
Question 3 –
Implementation: -
d1={'fruits':{1:"apple",2:"orange",3:"mango",4:"kiwi",5:"guava"},'vegetables':{
1:"potato",2:"broccoli",3:"carrot",4:"spinach"}}
print(d1['fruits'][3])
Output: -
Question 4 –
Implementation: -
d1={'fruits':{1:"apple",2:"orange",3:"mango",4:"kiwi",5:"guava",3:"banana"},'v
egetables':{1:"potato",2:"broccoli",3:"carrot",4:"spinach"}}
print(d1['fruits'][3])
Output: -
Question 5 –
Implementation: -
d1={'fruits':{1:"apple",2:"orange",3:"mango",4:"kiwi",5:"guava",3:"banana"},'v
egetables':{1:"potato",2:"broccoli",3:"carrot",4:"spinach"}}
print (d1)
Output: -
Question 6 –
Implementation: -
person = {
"first_name": "abc",
"last_name": "xyz",
"age": 19,
"city": "LKJ"
}
Output: -
Question 7 –
Implementation: -
d1={1:"apple",2:"orange",3:"mango",4:"kiwi",5:"guava"}
print(d1.popitem())
Output: -
Question 8 –
Implementation: -
d1={1:"apple",2:"orange",3:"mango",4:"kiwi",5:"guava"}
print(d1)
del d1
print(d1)
Output: -