Hi all I am trying to achieve the following

I would like to get numbers 0-3 depending on the input

-45 to -135 = 0

-45 to 45 = 1

-135 to -180 = 3

45 to 135 = 2

135 to 180 = 3

I am not even sure if that is the simplest way to interpret that

**# Enable Python support and load DesignScript library**

**import clr**

**clr.AddReference(‘ProtoGeometry’)**

***from Autodesk.DesignScript.Geometry import ****

**# The inputs to this node will be stored as a list in the IN variables.**

**dataEnteringNode = IN**

**# Place your code below this line**

**numberList = IN[0]**

**y = []**

**for x in numberList:**

*** if x < 45:***

*** y.Add(1)***

*** elif 45 <= x < 135:***

*** y.Add(2)***

*** elif 135 <= x < 180:***

*** y.Add(3)***

*** elif 0 <= x < -45:***

*** y.Add(1)***

*** elif -45 <= x < -135:***

*** y.Add(0)***

*** elif -135 <= x < -180:***

*** y.Add(3)***

**#Assign your output to the OUT variable.**

**OUT = y**

this is the code I have come up with.

[Python Practise.dyn|attachment]Python Practise Dynamo Forum.dyn (11.1 KB)