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)
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)
0 Comments
If you have any problem in code write in comments!