Skip to content

Commit 5d4e9ef

Browse files
committed
Commit
1 parent 3dfdaaa commit 5d4e9ef

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Delete.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#Q. 73:
2+
3+
#Delete(Dictionary)
4+
5+
#Write a program to delete the key and value of the Dictionary.
6+
#Define the dictionary in the program as follows
7+
#The Dictionary is as follows
8+
#dict = {2:4,3:9,4:16,5:25}
9+
#Input:
10+
#1. Get the key that needs to be deleted
11+
#Refer sample input and output for formatting specification.
12+
#All float values are displayed correct to 2 decimal places.
13+
#All text in bold corresponds to input and the rest corresponds to output
14+
15+
16+
dict = {2:4,3:9,4:16,5:25}
17+
k = int(input())
18+
del dict[k]
19+
print(dict)

0 commit comments

Comments
 (0)