Phenom interview question

Write a python script to extract IP's from given data and conditions.