How To Check Nested Array Length In Python