Isalpha?


#1



Replace this line with your code.


print 'Welcome to the Pig Latin Translator!'

Start coding here!

love = raw_input ('Happiness')
original = love

if len(original) > 0 and original.isalpha():

print 'love is life'
else:
print 'empty'

I did this wierd code and it worked. But I dont know why it worked orignal is all a letter character so when I put original.isaplha() that should retunr true and print love is life and not empty because len(orignial) is more than o and original contains all letter and not a single non letter. So WTF


#2

" ".isalpha() is false, spaces are not alphanumeric characters. a till z (and A till Z) is the only thing which is evaluated to true by isalpha


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.