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
new_word = word + first + pyg
new_word = new_word[1:len(new_word)]
please see this topic:
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?
Oh ok so the link to the page is: https://www.codecademy.com/courses/learn-python/lessons/pyglatin/exercises/testing-testing-is-this-thing-on-?action=resume_content_item
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 new_word = word + first + pyg new_word = new_word[1:len(new_word)] else: 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!