How do I erase a whole array, leaving it with no items?
I want to do this so I can store new values in it (a new set of 100 floats) and find the minimum.
Right now my program is reading the minimum from sets before I think because it is appending itself with the previous set still in there. I use .append by the way.
Note that
listandarrayare different classes. You can do:This will actually modify your existing list. David’s answer creates a new list and assigns it to the same variable. Which you want depends on the situation (e.g. does any other variable have a reference to the same list?).
Try:
and
Print
aandbeach time to see the difference.