PygLatin 8. Word Up


#1

I keep on getting this error message that says "It looks like first is "w" instead of "h" can someone please help me? I have been stuck on this one for almost three days. I'll include a screenshot.


#2

A little bit of 'cart before the horse' going on here. After receiving user input it should be tested before being given to word. Move that line up a couple of lines and see what results.


#3

@staiil,
As you use the code-line

first = 'word'[0]

you are collecting the =first= character of the string 'word'
instead of collecting the firt character of the associated Value of the variable word
like

first = word[0]

#4

I removed the ' ' from word and I am now getting "Did you create a variable called first?"


#5

Which line are you exactly talking about?


#6

@staiil
Display the FULL code you are now using ( please as text )


#7

pyg = 'ay'

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


#8

@staiil
As @mtf pointed out

pyg = 'ay'

original = raw_input('Enter a word:')
    #first test the input
    if len(original) > 0 and original.isalpha():
        word = original.lower()
        first = word[0]
        print original.lower()
    else:
        print 'empty'

Why are you printing
print original.lower()


#9

Alright I am pretty sure I got it thank you for the help guys :smiley:


#11

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