> for name in domains: > socket.gethostbyaddr(name) > print(name) > > output: > 173.252.120.6 > 98.139.183.24 > > What am I missing? Thank in advance. >
You have confused yourself a little because the variable names you've chosen are slightly misleading. Specifically, "name" is really an IP address. Hence, your loop here really should be: for addr in domains: ... I would also strongly suggest renaming "domains" to something like "domainAddresses", for similar reasons. Still, you do want a "name" at some point, since that's what you care about. Can you say in human language what the following will return? socket.gethostbyaddr(addr) Can you give it a good name? _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor