There are cases when both isalpha
and isdigit
returns False
, but isalnum
returns True
. So isalnum
is not just a combination of the other two.
>>> 'a1'.isalpha(), 'a1'.isdigit(), 'a1'.isalnum()
(False, False, True)
solved Python: is isalnum() the same as isalpha with isdigit?