Get Range Of Array Javascript Push Method In Python