CoCalc Shared Filessupport / 2014-12-16-binom.sagewsOpen in CoCalc with one click!
Authors: Harald Schilly, ℏal Snyder, William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
sum([binomial(10,np) for np in range (0,10)])
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sum([binomial(10,np) for np in [0..10]])
sum([binomial(10,np) for np in range(11)])
Help on built-in function range in module __builtin__: range(...) range(stop) -> list of integers range(start, stop[, step]) -> list of integers Return a list containing an arithmetic progression of integers. range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0. When step is given, it specifies the increment (or decrement). For example, range(4) returns [0, 1, 2, 3]. The end point is omitted! These are exactly the valid indices for a list of 4 elements.