# Extract IP address from file using Python # importing the moduleimport re# opening and reading the filewith open('C:/Users/user/Desktop/New Text Document.txt') as fh:   fstring = fh.readlines()# declaring the regex pattern for IP addressespattern = re.compile(r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})')# initializing the list objectlst=[]# extracting the IP addressesfor line in fstring:   lst.append(pattern.search(line)[0])# displaying the extracted IP addressesprint(lst)