I have a dict and I want to find out the max and min value with its key.

Ex-

dict_value={‘p’:2 ,’q’:5,’r’:8,’s’:1}

Output-

Max : 8 ,key is r

Min : 1, key is s

I know how to get min and max values from dict but is there any way to get values and keys in one statement?

max([i for i in dic.values()])

min([i for i in dic.values()])