String contains in Python

So i’ve been trying to learn python for dynamo

I’ve been trying to iterate a list of string to build a new one.
Strangely the code works in third party compilers, but not in dynamo, and i don’t know why

    NomeDoCircuito = [
"Iluminação - Recepção",
"Tomadas - Recepção".
"Tomadas - Consultório",
"Iluminação - Consultório",
"Ar - Sala de Curativo (7.000 BTU'S)",
"Ar - Recepção (18.000 BTU'S)",
"Ar - Sala de Consulta (12.000 BTU'S)",
"Ar - Sala de exame (9.000 BTU'S)"]

result = []

for name in NomeDoCircuito:
	if "Ilumi" in name:
	elif "Ar" in name:
	if "Tomada" in name:
	elif "Chuveiro" in name:

#Assign your output to the OUT variable.
OUT = result

It must be solved through python… I already know how to do it in standard Dynamo nodes.

Thank you all for your help!

you are missing on elif

1 Like


Edit : Your input is defined inside the script.

1 Like

I don’t believe i didn’t see that before asking help :man_facepalming::man_facepalming::man_facepalming:

1 Like

also :slight_smile:


1 Like