Then you'd want to strip the line then use the loop, so something like this would work for you:
import socket
file = '/Users/Python/Scripts/URL-list.txt'
f = open(file, 'r')
lines = f.readlines()
f.close()
for i in lines:
host = i.strip()
print("%s - %s" % (host, socket.gethostbyname(host)))