How can I know if my translator works properly?

I have the same problem and I completely don’t understand what you mean?

this programs translates user input (stored in original variable) into a pyglatin version (stored in new_word variable), so if you want to see the pyglatin version/translation, you will need to print it

I tried to but regardless of what I type in it prints just the word empty, nothing else

impossible to say what causes the issue without getting more information (like your code)

The only guess i can take is that spaces aren’t alphanumeric characters, so make sure not to use any spaces.

Oh sorry, for some reason I thought you can see my code.

It looks like this

pyg = ‘ay’

original = raw_input(‘Enter a word:’)

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
new_word = new_word[1:len(new_word)]
print ‘empty’

please see this topic:

How to ask good questions (and get good answers)

and then the bit about formatting your code (so i can see the indention).

i don’t see any other print statement except for printing empty, why is that?

1 Like

Oh ok so the link to the page is:

and the code looks like this

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
  word = original.lower()
  first = word[1]
  new_word = word + first + pyg
  new_word = new_word[1:len(new_word)]
    print 'empty'

and I’ve tried what has been suggested in the post about swapping o to a 1, and just playing with it in general, but I don’t think I understand what I don’t understand yet and what can be wrong?

where did i suggest that?

what is your question exactly?

Oh no I didn’t mean you suggested that I’ve just been reading the thread and I understood that someone tried that so I tried it myself.

So my exact question is how to make the PygLatin work? and what is wrong with my code that it doesn’t work now?

not working is such a vague definition, what is not working as expected? Is the output not printed? What?

So I meant it isn’t doing what I ask it to do, in the case of this exercise it isn’t giving me the desired output, so if I type in the word “manchester” it’s not turning it to anchestermay, it’s simply printing the word “empty” regardless of what I type in

unable to replicate issue:


i put your code in, and i don’t get empty. Are you sure you are not entering any spaces? They don’t count as alpha numeric characters

I’ve included a couple of hints in comments to your code above. Good luck && happy coding!

Thank you so much for sharing!!! Question: How would I have known to type this: out_word = new_word[1:len(new_word)]
instead of : new_word =new_word[1:len(new_word)]?

What you shared was not in the lesson.

Often times I check my work using the python 3.7.3 shell and it will work for checking for errors but behaves differentely than the terminal in codeacademy. Is there a terminal for python where it will behave the same as the one used in codeacademy?

If you take the free python course, its python2. so you could install python2.7.3 and use that. Then you have he same version as CC

I have the same issue. Can someone answer why? Is it limited to any amount of characters?

My translator doesn’t run at all.

i am going to be blunt, which very likely means i will get a flag. Your reply/question is not great, please see this topic:

How to ask good questions (and get good answers)

to provide the necessary information so we can help you

wow, i get a popup saying i already mention the ask good question topic within this topic. Do people not even bother to read the topic they are replying to? Now i am going to get a flag for sure.


I’m sorry sir/madam I didn’t realise that my question would bring such anger to your heart. As an unqualified 13y/o trying to learn so that she might have a better chance in the world I did not think about others. This and the fire that must burn in your eyes, puts me to shame as I should always put others before myself. Furthermore I will withdraw all further questions from your reign of terror (forum) as I do not want to hurt you or ruin your precious stomping grounds (Kingdom) again. Also I sincerely hope that you do not get flagged as this will damage my spirits and think I have caused unnecessary damage to others who where merely stating their (ferocious) mind to me.
After all we are only humans.

I will not be taking a look at that advice as I do know how to ask good questions(I am not stupid) and I thought it was pretty clear (evidently not all programmers are great thinkers).

Good luck