pygLatin. Can someone please me with this


#1

print 'Welcome to the Pig Latin Translator!'

Start coding here!

empty_string ="original"
if len is ("original") > 0: and if len is("original")< 0: .isalpha()
print original

else:
print "empty"
king = raw_input("who is the king of ile ife?")
original =raw_input()
print king


#2

empty_string ="original"

it's not an empty string.

if len is ("original") > 0: and if len is("original")< 0: .isalpha()

remember we are in programming language.so we dont need to tell like this(if len is).also it's not the right syntax to check the length of a variable and whether it's alphabetical characters or not.

you can do

if condition and second_condition:

to see the length of a variable do the following

len(variable_name)

isalpha()checks whether the string consists of alphabetic characters only.
Following is the syntax for islpha() method −

str.isalpha()


#3

Thanks... Although I ended up getting the right code through fluke. your explanation is super.


#4

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