hello i tried to make a email parser but it behaves weirdly can someone tell me why
def parser(wrds):
s = set()
for wrd in wrds:
splited_wrd = wrd.split(' ')
for i in range(len(splited_wrd)):
wrds_indexed = splited_wrd[i]
if ('@' and '.' in wrds_indexed) and (len(wrds_indexed) > 13):
s.add(wrds_indexed)
yield from s
x = 'heykidhello@gmail.com', 'heykidgmail.com', 'heykidhello@gmailcom','h@gmail.com'
print(list(parser(x)))
output:
['heykidgmail.com', 'heykidhello@gmail.com']
>>>
can someone tell me why does heykidgmail.com is in the list when it clearly doesnt have '@'
>>> '@' and '.' in 'heykidgmail.com'
True
when i ran it in console why does it say True when @ is not in the word ?