Pyglatin


#1

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
else:a
print “empty”

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


#2

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


#5

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


#6

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


#7

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