how to check value of any key in python