Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Last active June 29, 2020 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/dfdca9ab6364b4e4c373d42e08e5bccc to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/dfdca9ab6364b4e4c373d42e08e5bccc to your computer and use it in GitHub Desktop.
#identifier should not contain empty spaces
s1="Hello 123"
print (s1.isidentifier())#Output:False
#Identifier should not begin with numbers
s2="123hello"
print (s2.isidentifier())#Output:False
s3="_hello"
print (s3.isidentifier())#Output:True
s4="hello_123"
print (s4.isidentifier())#Output:True
#empty string
s5=""
print (s5.isidentifier())#Output:False
#white spaces
s6=" "
print (s6.isidentifier())#Output:False
#special characters are not allowed in identifiers
s7="hello@#$"
print (s7.isidentifier())#Output:False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment