# Create list from If else statement using code block

**andy13312496**#1

Hi all, I have two kinds of list for coordination, for instance there is two types of list for x =[a,b,c,d] z=[e,f,g,h] and x=[a1,b1,c1,d1] z=[e1,f1,g1,h1], and a varible p=, I want if p>4, and i will get x =[a,b,c,d] z=[e,f,g,h], else x=[a1,b1,c1,d1] z=[e1,f1,g1,h1], unfortunately I cant make it work, can anyone help me?

Many Thanks

**andy13312496**#5

Oh! I see!! But what if I wanted it in a single node?it is there anything wrong with the code?

many thanks

xt= ["a","b","c","d"];

zt=["e,"f","g","h"];

xf=["a1","b1","c1","d1"];

zf=["e1","f1","g1","h1"];

x = p>4?xt=[]:xf=[];

z = p>4?zt=[]:zf=[];

**mellouze**#6

Try this instead

```
xt= ["a","b","c","d"];
zt=["e","f","g","h"];
xf=["a1","b1","c1","d1"];
zf=["e1","f1","g1","h1"];
x = p>4?xt:xf;
z = p>4?zt:zf;
```

Or this :

```
x = p>4?["a","b","c","d"]:["a1","b1","c1","d1"];
z = p>4?["e","f","g","h"]:["e1","f1","g1","h1"];
```