Difficulty while writing programme


#1

print 'Welcome to the Pig Latin Translator!'

Start coding here!

original = raw_input("enter here")

if len(original) > 0 and original.isalapha():
print original
else:
print "empty"


#2

@rasika416,

Have a close look at

.isalapha()

http://stackoverflow.com/questions/18667410/how-can-i-check-if-a-string-only-contains-letters-in-python

https://docs.python.org/2/library/stdtypes.html

str.isalpha()
Return true if all characters in the string are alphabetic and there is at least one character, false otherwise.
For 8-bit strings, this method is locale-dependent

https://docs.python.org/2/library/functions.html


#3

You spelt isalpha wrong here, fix that and you should be fine assuming you have correct indents:


#4

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