How to find closest key in dictionary for each element in a list in Python

前端 未结 0 923
臣服心动
臣服心动 2021-01-30 03:55

If I have a dictionary and a list that looks like

dict = {\'10\': 5, \'25\': 12, \'40\': 6, \'55\': 18}

times = [3, 8, 27]

and I want to create

相关标签:
回答
  • 消灭零回复
提交回复
热议问题