I have a function where the user inputs the string s
.
If any character in s
is not in "0123456789e+-. "
, the function should return False
.
I tried this:
if any(s) not in "0123456789e+-. ":
return False
This:
if any(s not in "0123456789e+-. "):
return False
And This:
if any(character for character in s not in "0123456789e+-. "):
return False
How should I use the any()
function in this case?