# Interation coding

Hello eveyone,

Can you help me solve the problem of this node.
It say “closeparen” but I can’t find a place to input.

Any help would be appreciated.

1 Like

Thank you!

After some changes I get this node which create 20 point at the z=-1 and 16 points at z=1.
Though this node only give me 1 point at (0,0,-1)
Do you have any ideal?

1 Like

@dongthl not sure. DS gives me headaches

You could try in python:

``````import clr
from Autodesk.DesignScript.Geometry import *

OUT=[]
for i in range(IN[0]+1):
for j in range(IN[0]+1):
if i==0 or i==IN[0] or j==0 or j==IN[0]:
OUT.append (Point.ByCoordinates (i,j,-1))
else:
OUT.append (Point.ByCoordinates (i,j,1))``````
1 Like

Thank again!

I’m new to python so it will take time to understand your code.
I will learn python because it is clean and easy to understand

I still want to know how to solve my code though
they are missing something and it’s so anoying

``````num=5;
i=0..num;
j=0..num;
(i==0 || i==num || j==0 || j==num)
? Autodesk.Point.ByCoordinates(i<1>, j<2>, -1)
:Autodesk.Point.ByCoordinates(i<1>, j<2>, 1);``````
2 Likes

Many thank again!

The code work to me, but the result is different from the Python earlier.
And can you explain a bit about i<1> or j<2> part?

@dongthl Great!

I wasn’t sure of what output you were expecting and your end goal

Look at this short gif and look into Replication guides.

Please mark the topic as solved