Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は2つのリストを持っています
a = [1, 4, 12] b = [2, 13]
list bの値が の 2 つの値の間にあるかどうかを知りたいlist a ので、この場合、2 は 1 と 4 の間に収まります。13 はどの数字にも収まりません。
list b
list a
関数を試してみbisectましたが、うまくいきませんでした。単一の値とリストでは使用できましたが、2 つのリストでは使用できませんでした。
bisect