-
-
Save IndhumathyChelliah/dfdca9ab6364b4e4c373d42e08e5bccc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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