Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168747
Image: ubuntu2004
money=10000;years=0
while money<20000: years=years+1 money=money*1.0069
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_5.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("d2hpbGUgbW9uZXk8MjAwMDA6CiAgIHllYXJzPXllYXJzKzEKIG1vbmV5PW1vbmV5KjEuMDA2OQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpMQDlaA/___code___.py", line 5 money=money*_sage_const_1p0069 ^ IndentationError: unindent does not match any outer indentation level
x=0;x+=1;x
1
x=2;x**=2;x
4
x=[123,'xyz'];x+=[011];x
[123, 'xyz', 9]
x=y=z=123
x
123
y
123
z
123
x,y,z=1,2,3
x
1
y
2
z
3
x=666;y=888
x,y=y,x
x
888
y
666
#!/usr/bin/env sage x=1 x+=100
load myadd.sage
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_43.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bG9hZCBteWFkZC5zYWdl"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpOIwC2D/___code___.py", line 2, in <module> exec compile(u'sage.misc.preparser.load(sage.misc.preparser.base64.b64decode("bXlhZGQuc2FnZQ=="),globals(),False)' + '\n', '', 'single') File "", line 1, in <module> File "/usr/local/sage2/local/lib/python2.6/site-packages/sage/misc/preparser.py", line 1503, in load exec(preparse_file(open(filename).read()), globals) IOError: [Errno 2] No such file or directory: 'myadd.sage'
x
101
x
101
attach myadd.sage
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_45.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("YXR0YWNoIG15YWRkLnNhZ2U="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmp0k685G/___code___.py", line 2, in <module> exec compile(u'sage.misc.preparser.load(sage.misc.preparser.base64.b64decode("bXlhZGQuc2FnZQ=="),globals(),True)' + '\n', '', 'single') File "", line 1, in <module> File "/usr/local/sage2/local/lib/python2.6/site-packages/sage/misc/preparser.py", line 1503, in load exec(preparse_file(open(filename).read()), globals) IOError: [Errno 2] No such file or directory: 'myadd.sage'
x
101
x
101
load bubble_sort.py random number is [94,15,90,85,29,19,11,77,55,13]
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_57.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bG9hZCBidWJibGVfc29ydC5weQpyYW5kb20gbnVtYmVyIGlzIFs5NCwxNSw5MCw4NSwyOSwxOSwxMSw3Nyw1NSwxM10="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpsEqa_F/___code___.py", line 4 random number is [_sage_const_94 ,_sage_const_15 ,_sage_const_90 ,_sage_const_85 ,_sage_const_29 ,_sage_const_19 ,_sage_const_11 ,_sage_const_77 ,_sage_const_55 ,_sage_const_13 ] ^ SyntaxError: invalid syntax
cdef extern from "test.c": int myfactorial(int n)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_58.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Y2RlZiBleHRlcm4gZnJvbSAidGVzdC5jIjoKICAgaW50IG15ZmFjdG9yaWFsKGludCBuKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpkpBi4I/___code___.py", line 2 cdef extern from "test.c": ^ SyntaxError: invalid syntax
def test(n): resturn myfactorial(n)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_59.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZGVmIHRlc3Qobik6CiAgIHJlc3R1cm4gbXlmYWN0b3JpYWwobik="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpYZbnRv/___code___.py", line 3 resturn myfactorial(n) ^ SyntaxError: invalid syntax
attach test.spyx
Compiling test.spyx... Error compiling cython file: [Errno 2] No such file or directory: 'test.spyx'
test(8)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_65.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("dGVzdCg4KQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpaV2nvQ/___code___.py", line 3, in <module> exec compile(u'test(_sage_const_8 )' + '\n', '', 'single') File "", line 1, in <module> NameError: name 'test' is not defined
test(9)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_66.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("dGVzdCg5KQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpzLVWUU/___code___.py", line 3, in <module> exec compile(u'test(_sage_const_9 )' + '\n', '', 'single') File "", line 1, in <module> NameError: name 'test' is not defined