Help on "Word Up" on Pyglatin Part 2


#1

I keeps on asking me if i inserted a "Word Variable" any help?

***pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
print original
else:
print 'empty'***


#2

Hi, same problem to me with this:

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word(0)
print original
else:
print 'empty'

even more giving this syntax error:
"Traceback (most recent call last):
File "python", line 7, in
TypeError: 'unicode' object is not callable"


#3

Finally I fixed it.
in line
first = word(0) use first = word[0]
[] instead of ()

so this code has just gone through:

pyg = 'ay'

original = raw_input('Enter a word:')

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


#4

this isn't working for me, are you sure it's correct?


#5

i need help too it wont load


#6

But your word statement is not inside the if statement
as this
"Inside your if statement:"

pyg = 'ay'

original = raw_input('Enter a word:')

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


#7

I'm no genius, but putting those variables inside of an 'if' statement is making no sense to me. I simply created the variables then made the code print 'first' (no quotes) to see if the variables worked. WHY does it want me to put the variables inside of the 'if' statement?


#8

It says that my code is correct, however, it does not print lower case first letter as instructed in the exercice.

I cannot figure out why it doesn't print out lower case, any hints?


#9

Its because you have the print set to original on line 8 and that's what is being printed; if you switch that to word it will print original.lower. I think it says its correct because there is nothing wrong with your code, its just not doing what you want it to do.


#10

Thank you for your help.
I got to get used of the concept that even if the code is correct it might not be the correct result that I wanted initially.