Checking Length Of An Array In Python