I'm having some issues and just want to know what it may be because I've tested properly some of my code. Why is this code not working ? This is the code displayed below.
search_for_term = re.findall(r'<td class="kx o_\d.*data-bookmaker', doc)
This is the output of searc_for_term variable:
['<td class="kx o_1 winner" data-bookmaker',
'<td class="kx o_0" data-bookmaker',
'<td class="kx o_2" data-bookmaker']
Now I'm trying to find if any string contains word "winner". Code is shown below.
winner_ids = np.where([re.findall('winner', item) for item in search_for_term])
And now is the code which confuses me :
if(not all(winner_ids)):
print("no winner")
else:
print("winner does exist")
The output I get is "no winner". Can somebody explain this to me. I would be more than greatful.