Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to use for loops and assign values to array

For x in range If I == 3 Print....

I'm unable to print the 3rd line it always says space indent etc.

How to solve this? Also please help me how to assign values in an array in for loop

Also binary values I should store in array how to??

I'm new please help

I'm using this only on sagemath cell server online

Thanks

How to use for loops and assign values to array

For x = 3 z = IncreasingArrays() z = x.binary()

for i in range range(x): if z[i] == 1: If I == 3 print(' ', 2^i) Print.... # Not printing here

I'm unable to print the 3rd line it always says space indent etc.

How to solve this? Also please help me how to assign values in an array in for loop

Also binary values I should store in array how to??

I'm new please help

I'm using this only on sagemath cell server online

Thanks