【发布时间】:2012-08-09 01:17:39
【问题描述】:
可能重复:
finding index of an item closest to the value in a list that's not entirely sorted
我有一个 Python 中的正数和负数列表 ([237, 72, -18, 237, 236, 237, 60, -158, -273, -78, 492, 243])。我想找到最接近 0 的数字。我该怎么做?
【问题讨论】:
-
stackoverflow.com/questions/9706041/… 好像有人问和回答了同样的问题。
标签: python algorithm list numbers