Question about the PygLatin code


#1

Just want to clarify I have passed the pyglatin course so far but I just don't understand why it allows me to continue here is the code. For some reason in the preview it doesn't do the spacing but don't worry I have the spacing after the if statement. When I run this code even though I enter a word it still prints empty, why is that? Good lord I just the Word up exercise in Pt2. and I don't even know why it worked.

original = raw_input("Enter a word.")
original = ""
if len(original) > 0 and original.isalpha():
print original
else:
print "empty"

`


#2

new question within this thread to minimize spam.

I'm doing "Ending up" and this is my code, keep in my spacing is in my code but not present in this thread :

pyg = 'ay'
word = original.lower()
first = "word"[0]
new_word = word + first + pyg
s = "new_word"
print s[0:7]
original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
print original
else:
print 'empty'

The error I get is

Oops, try again. word should contain the .lower()-case version of original.

What am I supposed to do?


#3

word is a variable (you defined it the line above), you should use the variable, not a string (Remove the quotation marks)


#4

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