Anonymous user
Price fraction: Difference between revisions
→{{header|Python}}: Whoops!
(→{{header|Mercury}}: add implementation) |
(→{{header|Python}}: Whoops!) |
||
Line 1,392:
<lang python>>>> import bisect
>>> _cin = [ 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101]
>>> _cout = [10, 18, 26, 32, 38, 44, 50, 54,
>>> def centsrounder(centsin):
return _cout[ bisect.bisect_right(_cin, centsin) ]</lang>
|