環境 linux mint18
python 3.5.2
python
1import bisect 2 3def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'): 4 i = bisect(breakpoints, score) 5 return grades[i] 6 7[grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]
import bisect で、TypeError: 'module' object is not callable $ sudo pip3 install bisect で Could not find a version that satisfies the requirement bisect (from versions: ) No matching distribution found for bisect 要件bisectを満たすバージョンを見つけることができませんでした(バージョンから:) 二等分線に一致する分布が見つかりませんでした
ですから,
import bisectを消したら、
NameError: name 'bisect' is not defined 関数内にglobal と書いてもダメでした。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/04/22 00:22