Python Finding Lowest Value In Nested Loop