Ask Your Question

tim602's profile - activity

2018-01-11 20:25:27 +0200 asked a question Adding a sagecode

How can i make a sagecode , because i only see "enter code here"

2018-01-11 20:25:27 +0200 asked a question I need help to find the mistake in my code.
enter code here ︠832f6484-6063-439a-a2dc-4dc38b8a4bcfs︠

A=Matrix([[1,2,0],[4,5,0],[7,8,9]]);A def Kostenmatrix(A): C=Matrix(A.nrows(),[]) for i in range(0.A.nrows()): for j in range(0,A.nrows()): if i==j: C[i,j]=0 elif A[i,j]==0 and i<>j: C[i,j]=10^4 else: C[i,j]=A[i,j]

return C

Kostenmatrix(A) ︡1d7ac8e1-aea5-4323-8e3c-45ee125883e2︡{"stdout":"[1 2 0]\n[4 5 0]\n[7 8 9]\n"}︡{"stderr":"Error in lines 13-13\nTraceback (most recent call last):\n File \"/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 1013, in execute\n exec compile(block+'\n', '', 'single') in namespace, locals\n File \"\", line 1, in <module>\n File \"\", line 3, in Kostenmatrix\n File \"sage/structure/element.pyx\", line 484, in sage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4377)\n return self.getattr_from_category(name)\n File \"sage/structure/element.pyx\", line 497, in sage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4486)\n return getattr_from_other_class(self, cls, name)\n File \"sage/cpython/getattr.pyx\", line 254, in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:1901)\n raise dummy_attribute_error\nAttributeError: 'sage.rings.integer.Integer' object has no attribute 'A'\n"}︡{"done":true}︡

2018-01-11 20:25:27 +0200 asked a question Need to figure out my mistake. AttributeError: 'sage.rings.integer.Integer' object has no attribute 'A'

Hello guys