Is this a bug? [Solved]


#1


I'm "stuck" on scrabble_score, which is exercise number 9 on lesson 15

My exact error massage is:

Oops, try again. Your function fails on scrabble_score("pie"). It returns "5" when it should return "5".

I just want some one to help understand why I'm getting this error and if it is a bug, I want the website to fix it.

def scrabble_score(word):
    total = 0 
    for letter in range(len(word)):
        let = word[letter].lower()
        total = total + score[let]
    return str(total)
print scrabble_score("pie")


#2

Return a number, not a string.


#3

Oh, sorry, I thought I had to convert it into a string to print, for some reason. I did what you said, and now it works. Thanks!


#4

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