All String methods
Returns True if the string is an identifier. Otherwise returns False.
Identifiers are names used to create objects, variables, functions, modules etc.

What is identifier ( Rules )

  1. Only lower or upper case chars , digits and underscore are allowed.
  2. We can't start identifier name with digit.
  3. $ , # , @, !, % ,special chars and space can't be used with identifiers
  4. We can't use reserved keywords as identifiers.
print(my_str.isidentifier()) # Output is True

print(my_str.isidentifier()) # Output is False ( # not allowed )

print(my_str.isidentifier()) # Output is True

print(my_str.isidentifier()) # Output is False ( ? not allowed)

my_str='pq rs'              
print(my_str.isidentifier()) # Output is False ( space not allowed)

print(my_str.isidentifier())#Output is False( Can't start with number)

All String methods variables & identifiers in Python

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2022 All rights reserved worldwide Privacy Policy Disclaimer