Python String isidentifier() method Syntax

Syntax:  string.isidentifier()

Parameters: The method does not take any parameters

Return Value:  The method can return one of the two values: 

  • True: When the string is a valid identifier.
  • False: When the string is not a valid identifier.

Python String isidentifier() Method

Python String isidentifier() method is used to check whether a string is a valid identifier or not. The method returns True if the string is a valid identifier, else returns False.

Similar Reads

Python String isidentifier() method Syntax

Syntax:  string.isidentifier() Parameters: The method does not take any parameters Return Value:  The method can return one of the two values:  True: When the string is a valid identifier. False: When the string is not a valid identifier....

Python String isidentifier() Method Example

Python3 string = "Coding_101" print(string.isidentifier())...