This just has to be a dupe, but I just didn't find any existing instance of this question...
What is the easiest way to convert any iterable to an array in Python (ideally, without importing anything)?
Note: Ideally, if the input is an array then it shouldn't duplicate it (but this isn't required).