Python Script From String - Code Block Error

Hi All,

If I try to insert the python code below in a code block a get an error. It runs okay in a Python Script node.

is there a solution?


OUT =["Span " + str (i) + " " + “On_Off” for i in range(1,11)]

It’s because of the double quotes . Try this :
“OUT =['Span ’ + str (i) + ’ '+ ‘On_Off’ for i in range(1,11)]”



Thanks that worked! :grinning:

@salvatoredragotta @Mostafa_El_Ayoubi is right