Nothing happens at the end of PygLatin


#1
```python I've done what I thought would be correct and the 11/11 gets marked green, but when I run the code, nothing happens. It shows Enter a word: and it either doesn't let me type in anything or I type in a word, press Enter and nothing happens. How can I know it works? I tried adding print "new_word" but nothing happens. I feel like I'm missing something :D Can anyone explain?

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)]
else:
print ‘empty’

<do not remove the three backticks above>

#2

adding a print statement at the right spot to print new_word should display the pyglatin version of the word enter

how and where did you add the print statement? Please show full code


#3

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 "new_word"
else:
print ‘empty’

I deleted the first try. I added print again now, but now it only literally shows new_word
Like so:
Enter a word:failure
new_word

at least now it allows me to write a word, but it doesn’t go pyglatin


#4

oh, ignore that. I just realised I wrote print "new_word" instead new_word
makes a world of difference :sweat_smile:


#5

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