Binary digits: Difference between revisions
→Custom functions: Updated output to conform with task description tests.
(→Custom functions: Updated output to conform with task description tests.) |
|||
Line 2,980:
def main():
'''Test'''
print('Mapping showBinary over integer list:')
print(unlines(map(
showBinary,
[5, 50, 9000]
)))
print(tabulated(
'
)(str)(
)([5, 50, 9000]))
Line 3,049 ⟶ 3,055:
main()</lang>
{{Out}}
<pre>Mapping showBinary over integer list:
101
110010
10001100101000
Using showBinary as a display function:
5 -> 101
50 -> 110010
|