Example of Dictionary function in Python


acc={}
for i in range (0,3):
    v=input("\nEnter username : ")
    x=input("\nEnter password : ")
    acc[v] = x
   
print(acc)

print("After use of fromkeys")
acc.fromkeys(v,[x])
print(acc)

print("After use of clear")

acc.clear()
print(acc)

Output:-






Post a Comment

0 Comments