This article mainly introduces the use of the Isalnum () method in Python, which is the basic knowledge in Python's introductory study, and the friends who need it can refer to
The Isalnum () method checks whether the string contains alphanumeric characters.
The following is the syntax for the Isalnum () method:
Returns false if all characters in a string are alphanumeric and at least one character this method returns True.
The following example shows the use of the Isalnum () method.
|1 2 3 4 5 6 7||#!/usr/bin/python str = "this2009"; # No spaces in this string print str.isalnum (); str = "This is string Example....wow!!!"; Print Str.isalnum ();|
When we run the above program, it produces the following results:
|1 2||True Fal Se|