Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168728
Image: ubuntu2004
%gap s := (1,2,3)*(2,5)
(1,5,2,3)
s
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_8.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cw=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmp6FTGMT/___code___.py", line 2, in <module> exec compile(u's' + '\n', '', 'single') File "", line 1, in <module> NameError: name 's' is not defined
t = gap('s')
print t
(1,5,2,3)
type(t)
<class 'sage.interfaces.gap.GapElement'>
t.Order()
4
%gap Order(s)
4
t = gap('(1,2,3)*(2,5)(7,13)')
t
( 1, 5, 2, 3)( 7,13)
t.name()
'$sage2'
PermutationGroup([t])
Permutation Group with generators [(1,5,2,3)(7,13)]
gap.eval('a := 2 + 3;\nb := a+1; b')
'5\n6\n6'
%gap Print(a)
5
t
(1,5,2,3)
t
(1,5,2,3)