I have a python dict

```
a = {
     "Ram":(20,"Male"),
     "Shyam":(22,"Male"),
     "Shruti":(19,"Female"),
    }

```

I want to check whether a name is present in the dict as key and return age based on it otherwise name. So I have written the following function for it

```
def func(val ):
   if val in a:
     return ( a[val][ 0 ], True ) # Return age and key in dict?
   return ( val, False )

```

Can I write this in a better way? A one liner or something?

Thanks