In dictionary where keys are numbers, how to find key which is smaller then a given number but the most near to given number ?
I can sort list of keys in ascending and then while but is there more python way to do this ( I am from Java and this is Java approach)
example:
{{1:9}, {6:7}, {5:45}, {3:90}}
for given number 4 result is 3