Aug-11-2022, 10:48 PM
Greetings!
It is probably an elementary problem for you but I'm struggling to understand why the snippet below is failing.
I found it online and it looks ok, but it is not.
"int() argument must be a string, a bytes-like object or a number, not 'filter'"
if anyone would explain to me why it errors out...
Thank you!
It is probably an elementary problem for you but I'm struggling to understand why the snippet below is failing.

I found it online and it looks ok, but it is not.
s = 'November 11 day' pp = int(filter(str.isdigit, s)) print(f" Digits only -> {pp}")error:
"int() argument must be a string, a bytes-like object or a number, not 'filter'"
if anyone would explain to me why it errors out...
Thank you!