Python Check If Variable Is Array Or String Of Pearls