Ask Your Question

jhonvi2's profile - activity

2023-12-06 01:28:46 +0100 received badge  Notable Question (source)
2023-03-20 19:27:47 +0100 received badge  Popular Question (source)
2021-10-09 11:35:58 +0100 received badge  Editor (source)
2021-10-09 11:35:58 +0100 edited question For vs while loop

For vs while loop Hi there! I am new to sageMath and I´m trying to solve a certain exercise with my buddy, the thing is

2021-10-09 11:26:57 +0100 asked a question For vs while loop

For vs while loop Hi there! I am new to sageMath and I´m trying to solve a certain exercise with my buddy, the thing is

2021-10-08 23:08:32 +0100 commented answer other way of creating a list of perfect squares

@tmonteil ok so I could do something like n =95 cuadrados=[ ] i=0 root= int(sqrt(n)+1) while i

2021-10-08 23:08:11 +0100 commented answer other way of creating a list of perfect squares

@tmonteil ok so I could do something like n =95 cuadrados=[ ] i=0 root= int(sqrt(n)+1) while i &l

2021-10-08 22:41:51 +0100 commented answer other way of creating a list of perfect squares

@tmonteil ok so I could do something like i=0 root= int(sqrt(n)+1) while i < root: cuadrados.append(i*i)

2021-10-08 22:41:37 +0100 commented answer other way of creating a list of perfect squares

@tmonteil ok so I could do something like i=0 root= int(sqrt(n)+1) while i < root: cuadrados.append(i*i)

2021-10-08 22:41:31 +0100 commented answer other way of creating a list of perfect squares

@tmonteil ok so I could do something like i=0 root= int(sqrt(n)+1) while i < root: cuadrados.append(i*i)

2021-10-08 22:40:44 +0100 commented answer other way of creating a list of perfect squares

@tmonteil ok so I could do something like root= int(sqrt(n)+1) i=0 while i < root: #para cada numero hasta la raiz

2021-10-08 20:53:48 +0100 marked best answer other way of creating a list of perfect squares

Hi there! I am currently explaining a certain exercise to my buddy and part of it consists in creating a list of perfect squares up to root of 64 (included) therefore the list has to look like this [0, 1, 4, 9, 16, 25, 36, 49, 64] My first idea was this

squares=[i*i for i in range(sqrt(64)+1)]

which works but I am now trying to do it in a way so that is not compressed such us

 for i in range(sqrt(64)+1)
        squares=[i*i]
    print(squares)

But I keep getting this error

 for i in range(sqrt(Integer(64))+Integer(1))
                                                ^
SyntaxError: invalid syntax

Any ideas of what I am doing wrong?

2021-10-08 20:53:48 +0100 received badge  Scholar (source)
2021-10-07 18:36:02 +0100 commented answer other way of creating a list of perfect squares

Hi! thank you so much for your help my code is better now! I just do not really understand your last statement 'if you w

2021-10-07 13:07:59 +0100 received badge  Student (source)
2021-10-07 13:04:46 +0100 asked a question other way of creating a list of perfect squares

other way of creating a list of perfect squares Hi there! I am currently explaining a certain exercise to my buddy and p