0

I'm using eval and pybrain to make neural networks. Here's it stripped down. Using python 3.6


    from pybrain import *

    numnn = 100

    eval("neuralNetwork" + chr(numnn) + " = buildNetwork(2, 3, 1, bias=True)")

1 Answers1

3

eval evaluates expressions. Assignment in Python is not an expression, it's a statement.

But you don't need this anyway. Make a list or dict to hold all of your values.

Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662