I actually tried to define something at the start and had an error due to a random space (with half done code) and the site considered the program complete and moved me on to the next one. Shouldn’t it at least check if the raw_input was printed correctly in pyglatin?
I also originally read the task as confirming if the string is indeed a number and using a loop until a proper word is entered mostly due to this - Make sure the user entered a valid word. though it seems in this thread that they only want to make sure you don’t enter nothing.
I also don’t quite remember being taught english_word[1:] in order to remove the first letter but it might just be me being forgetful.
Oh, nevermind, I’m an idiot. I was at Pyglatin - Break It Down and I assumed I already had to write the code for it there (which I sorta did). My bad. On with the lesson. :C
This is a program that will translate a word into pig latin.
en_word = “English”
print “This program will translate an English word into Pyglatin.”
en_word = raw_input("Please enter a valid English word: ")
if len(en_word) > 0:
print “Removing the first letter of the word.”
en_first_letter = en_word
en_word = en_word[1:]
print “Moving the first letter of the word to the end and adding -ay.”
print en_word + en_first_letter.lower() + “ay”
print “You did not enter a valid word.”