I have function that at some point has list of strings (e.g. {"apple","pear"}
) and I want to declare (initialize) those variables in notebook namespace to default value (e.g. 0
) so I could execute in next cell
apple+pear
It is important that it is done this way - I don't want return from function. (I'm automatically importing variable names and values from Python)
(Evaluate[Symbol[#]] = 0) & /@ {"apple", "pear"}
? if so there is a duplicate, I just can't find it. $\endgroup$