2

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)

Kuba
  • 136,707
  • 13
  • 279
  • 740
Bruno Cuc
  • 21
  • 1
  • This one 2926 or maybe some from links linked there: 6511 – Kuba Apr 27 '15 at 22:30
  • Generally something like (Evaluate[Symbol[#]] = 0) & /@ {"apple", "pear"}? if so there is a duplicate, I just can't find it. – Kuba Apr 27 '15 at 22:33
  • Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. – bbgodfrey Apr 27 '15 at 23:15
  • @Kuba : your code works, thanks! (you can post it as an answer if you want to) – Bruno Cuc May 01 '15 at 02:41

0 Answers0