Evaluate binomial coefficients: Difference between revisions
→Functional Python: Added tests for k=0 to k=5 (where n = 5)
(→{{header|Python}}: Added a second (Python 3 compatible) functional version) |
(→Functional Python: Added tests for k=0 to k=5 (where n = 5)) |
||
Line 1,926:
#
print(
binomialCoefficient(5)(3)
)
# k=0 to k=5, where n=5
print(
list(map(
binomialCoefficient(5),
enumFromTo(0)(5)
))
)</lang>
{{Out}}
<pre>10
[1, 5, 10, 10, 5, 1]</pre>
=={{header|R}}==
|