Question: How to create list with for-loop

So basic problem.

 

I want to create a list with undetermined size. I have some data, let's say these data objects are numbers for now (they can be expressions of variables, or even equations)

 

Here is a pseudocode,

 

for n=1:10

  list(n) = n+1;

end

 

So the above for loop will create a list of size 9, with objects being number 2 through 11.

 

I want the list to be in {} form

 

Now I awnt to take this further. Let's say my data objects aren't just numbers, but expressions. How would I create a list of expressions and turning them into an equation?

 

Example

 

e1 := a^2 + b

e2 := b + a*b

 

e3:= b*a + a*b^2

 

Pesudocode

 

for i = 1:3 do

list(i) = ei ~=0;

end

 

Output should look like

 

list = {a^2 + b = 0, b + a*b=0,b*a + a*b^2=0}

 

Notice the use of curly braces

 

Please Wait...