A
Anoop
Hi All
I am getting two different outputs when i do an operation using
string.digits and test.isdigit(). Is there any difference between the
two. I have given the sample program and the output
Thanks for ur inputs
Anoop
#1:
~~
import string
test='121206'
if test not in string.digits:
print "I am Not Digit"
else:
print "I am Digit"
#2:
~~
import string
test='121206'
if not test.isdigit():
print "I am Not Digit"
else:
print "I am Digit"
Output
~~~~~
#1:I am Not Digit
#2:I am Digit
Thnks and Rgds
Anoop
I am getting two different outputs when i do an operation using
string.digits and test.isdigit(). Is there any difference between the
two. I have given the sample program and the output
Thanks for ur inputs
Anoop
#1:
~~
import string
test='121206'
if test not in string.digits:
print "I am Not Digit"
else:
print "I am Digit"
#2:
~~
import string
test='121206'
if not test.isdigit():
print "I am Not Digit"
else:
print "I am Digit"
Output
~~~~~
#1:I am Not Digit
#2:I am Digit
Thnks and Rgds
Anoop