print ‘Welcome to the Pig Latin Translator!’

Start coding here!

original = raw_input("Enter a word: ")

if len(original) > 0 and original.isalpha():
print original
print “empty”

I have this code but when it does not work for special character like ‘$’ or ‘$1’


isalpha checks for alphanumeric characters, so that is a till z and A till Z.


Actually isalpha() checks for alphabets and not for numbers.
Or am I mistaken?


isalpha checks if all the characters in string are a-zA-Z. No other symbols (spaces, numbers, special symbols like !@#$ for example) allowed


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