From the following, which function of Python checks whether all characters in a string 's' are alpha numeric?

ICSE Class 10 Robotics & AI PYQ · 2026 Paper · Section A

1(vii)1 Mark · 2026 · Section A · 2026 Paper

From the following, which function of Python checks whether all characters in a string 's' are alpha numeric?

Show SolutionHide Solution↓

s.isalnum()

Reason — The function isalnum() is used to check whether all characters in a string are alphanumeric (i.e., letters and numbers). It returns True if all characters are either alphabets or digits, otherwise it returns False. The other options are incorrect because they are not valid Python string methods.

← Previous questionNext question →

Browse the free Robotics & AI sample bank