Nested While Loop In Python Using Range