Nested Loop Definition In Python Example