Python Use Variable In Nested Loop