Found on page 75. Uses the string.join() function to produce a comma separated string of IP addresses. The ", " item at the beginning is a static sting object which servers as the delimiter between items in the new string.
Found on page 82. Uses the string.split() function to make a list of octets (between 0 and 255) of an IP address. A very common string processing technique is to use string.split() to make a list from a string. Then some processing can easily be done with one element of the list at at time. Then, when the data is as desired, use string.join() rebuild the string with new data.
Found on page 83. This prints a line of 77 dashes (-). Just the * + * operator concatenates strings, the * * * operator replicated the string the specified number of times.
Found on page 83. This determines if the value from the dictionary lookup is one of either ‘CNAME’ or ‘PTR’. The in operator is a convenient means of testing if is something is a part of a sequence. Here, the list sequence was generated just so that the in could be used. The alternative statement follows. You be the judge of which is a better way to express the same:
if answer['typename'] == 'CNAME' or answer['typename'] == 'PTR':