A Little Help?


#1

So I'm working on the Pyglatin Translator, and I just typed in what I thought was correct (see below). However, when I submitted the code, the stage said: 'Traceback (most recent call last):
File "python", line 7, in
TypeError: 'builtin_function_or_method' object has no attribute 'getitem'" and Codecademy said: "Oops, try again. Did you create a variable called first?." What is wrong? Please help!


Replace this line with your code.


#2

Ooop, forgot to post the code

pyg = 'ay'

original = raw_input('Enter a word:')

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

#3

.lower() is a method, calling a method (just like function) requires parentheses


#4

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