When you iterate the answer object, you're actually iterating the RRset that is the answer to the question you asked, so you're getting a sequence of Rdatas of whatever type you asked for. In your case, it's a sequence of PTR objects. So, you're comparing a PTR object to a string, and those are not ever going to be equal. The name the PTR points to is in the "target" field of the PTR object, and that field is a
dns.name.Name, not a string, so you want to compare that field to a name. Here's how to do that:
```import dns.resolver
answer = dns.resolver.query('8.8.8.8.in-addr.arpa', 'PTR')
for rdata in answer:
if rdata.target == google_dns:
print('Found', google_dns)
```