Check the Key

 Check the Key


a=int(input())
b=int(input())
c=int(input())
d=int(input())
di1={a:b}
di2={c:d}
print("First Dictionary")
print(di1)
print("Second Dictionary")
print(di2)
di3={**di1,**di2}
print("Concatenated dictionary is")
print(di3)
s=int(input())
flag=0
for k,v in di3.items():
  if k==s:
    print("Key is present and value of the key is")
    print(v)
    flag=1
if flag==0:
  print("Key not present")

Comments