Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168749
Image: ubuntu2004
a=5 a
5
2==2
True
2>3
False
2**3
8
2^3
8
5/2
5/2
5//2
2
18%5
3
012
10
09
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_12.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("MDk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmp2XKc2E/___code___.py", line 2 _sage_const_09 = Integer(09) ^ SyntaxError: invalid token
sin?

File: /usr/local/sage2/local/lib/python2.6/site-packages/sage/functions/trig.py

Type: <class ‘sage.functions.trig.Function_sin’>

Definition: sin(*args, coerce=True, hold=False, dont_call_method_on_arg=False)

Docstring:

The sine function.

EXAMPLES:

sage: sin(0)
0
sage: sin(x).subs(x==0)
0
sage: sin(2).n(100)
0.90929742682568169539601986591
sage: loads(dumps(sin))
sin
def is_even(n): return n%2==0
is_even(2)
True
is_even(123)
False
def myfunction(x): if x<0: return -1 elif x==0: return 0 else: return 1
myfunction(-2)
-1
myfunction(0)
0
myfunction(3)
1
money=10000 years=0 while money<20000: years=years+1 money=money*1.069
years
11
money
20833.1411965483
n=10;ans=1; for each in range(1,n+1): ans=ans*each
ans
3628800
for eachitem in ['name:vincent','age=30','job:teacher']: print eachitem
name:vincent age=30 job:teacher