i = range(0,40,1)
y = 0.1 * cos((i)/20 * pi)
The error I get is this:
TypeError: unsupported operand type(s) for /: 'list' and 'int'`
I am not sure how to remove that error. I type-casted i to int, but its a list, thus can’t be type-casted. I am following this example. http://msenux.redwoods.edu/math/python/simple.php
They are using pylab’s
arange, not simple pythonrange. And this is the problem whenimporting *: you don’t know which method comes from where. Import just pylab and reference to all its methods/constants withpylab.. You will really love this way of programming when you’ve got several imports.will work.