Python Check If Variable Is An Array A Stack