Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168694
Image: ubuntu2004
range(11)
[0..10]
range(1, 11)
[1..10]
range(1, 11, 2)
[1..9, step = 2]
range(0, 11, 2)
[0..10, step = 2]
# defining functions in Python def f(x): return x**2 + 3*x +1
# defining function in SAGE f(x) = x^2 + 3*x + 1
f(12)
# Define a list containing the first 10 powers of 3. # in Python - [3**x for x in range(11)]
# in SAGE - [3^x for x in [0..10]]
# Define a function that will compute 5 less than the xth power of 2. # in Python - def f(x): return 2**x - 5
# in SAGE - f(x) = 2^x - 5
# Construct a list containing the values of f(x) for x from 0 through 10. # Python - [f(x) for x in range(11)]
# SAGE - [(x, f(x)) for x in [0..10]]
points([(x, f(x)) for x in [0..10]])
reset()