9/15 'builtin_function_or_method' object is not iterable' error


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/3?curriculum_id=4f89dab3d788890003000096#


It shows:

"Does your scrabble_score function take exactly one argument (a
string)? Your code threw a "'builtin_function_or_method' object is not
iterable" error."


I don't know why this code doesn't work. Can anyone please help me?
Thank you!


def scrabble_score(word):
    total =0
    word = word.lower
    for char in word:
        total += score[char]


#3

It should be:
word = word.lower()

instead of:
word = word.lower

and also, don't forget to add:
return total


#4

Thank You!! It works now.


#5

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