Computer Science, asked by monsterdelhi3546, 10 months ago

Write the syntax for isalnum( ) method.

Answers

Answered by NirmalPandya
2

•The isalnum() method is used to give "True" or "False".

• If all the characters in the string are alphanumeric it will return TRUE.

• If not then return FALSE.

• Syntax:

name= "RAMESH385"

print (name.isalnum())

Output: True

Answered by letmeanswer12
0

Syntax for isalnum( ) method

Explanation:

Python isalnum() string method tests whether the string consists of alphanumeric characters or not.

  • Syntax - str.isalnum()
  • Parameters - Takes no parameters
  • Return Value - This method returns true if all characters in the string are alphanumeric and false if at least one character is not alphanumeric.

Example:

  • #!/usr/bin/python
  • str = "this2020";
  • print str.isalnum()
  • str = "this is string isalnum() example.";
  • print str.isalnum()

The above program gives the following output −

  • True
  • False

Similar questions