Python Check If Array Or String Of Pearls