ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 27 Jan 2019 19:11:51 +0100Can you please help me with this task in sage?https://ask.sagemath.org/question/45206/can-you-please-help-me-with-this-task-in-sage/1) Enter the program function sum_quadrate() with matrix A.The function returns the sum of those matrix elements that are complete squares.
The x is complete square if the command is_square (x) returns the True value.
[4 1 6 ]
matrix A=[1 3 9 ]
[2 7 25]
...
def sum_quadrate (A):
m=A.nrows()
n=A.ncols()
True=0
for i in range (m):
for j in range(n):
if....???
I wrote this but from last row i dont know what goes next
Sun, 27 Jan 2019 17:39:54 +0100https://ask.sagemath.org/question/45206/can-you-please-help-me-with-this-task-in-sage/Comment by slelievre for <p>1) Enter the program function sum_quadrate() with matrix A.The function returns the sum of those matrix elements that are complete squares.
The x is complete square if the command is_square (x) returns the True value.</p>
<pre><code> [4 1 6 ]
</code></pre>
<p>matrix A=[1 3 9 ]
[2 7 25]
...</p>
<p>def sum_quadrate (A):
m=A.nrows()
n=A.ncols()
True=0
for i in range (m):
for j in range(n):
if....???
I wrote this but from last row i dont know what goes next</p>
https://ask.sagemath.org/question/45206/can-you-please-help-me-with-this-task-in-sage/?comment=45213#post-id-45213Duplicate of [Ask Sage question 45207](https://ask.sagemath.org/question/45207).Sun, 27 Jan 2019 19:11:51 +0100https://ask.sagemath.org/question/45206/can-you-please-help-me-with-this-task-in-sage/?comment=45213#post-id-45213