Home > other >  Python for help
Python for help

Time:02-08

Def findk (DCT, * * kargs) :
R={k: v for k, v in kargs. The items () if DCT. Get (k)==v}
Return r

D={39, 'a' : 'b' : 40, 'c' : 99, 'd' : 100}
Fr=findk (d, a=1, b=40)
Print (fr)



R={k: v for k, v in kargs. The items () if DCT. Get (k)==v}
K: here V is what meaning, don't understand, turn to god

CodePudding user response:

To get the data from the kargs, if found in DCT, have built a dictionary return
K is the key, v is the value
  • Related