This is my first post about Python as I am starting my learning path through this programming language!
I could not see any learning resource on the internet which is focused on Python sessions applied in Dynamo so I will have to look into many websites in order to learn the basics and then apply them into Dynamo environment.
Here I post a screenshot with the issue I am behind.
values = IN[0]
conditions = IN[1]
OUT = []
i = 0
while i < len(values):
if conditions[i]:
OUT.append(values[i]+"_CONTROL")
else:
OUT.append(values[i])
i = i + 1
PS: I am by no means any good in Python, if anyone has some suggestions to improve and/or simplify this, please don’t hesitate
@JMCiller the statement you are using in your conditional if is a string, you should use a valid boolean(True in Python, true in DS), plus to make it work properly you couple the inputs of the lists items with the bools items using a zip function;
The second approach is a comprehension list, worth looking at if you are planning to learn Python: