Having in mind several solutions to an exercise I wonder which one is better?
As a student here I realize that there are lots of ways to solve a given problem, but anyway, from the self-improvement perspective I would like to know what method is more preferable optimization-wise, etc.
p.s. removed ‘if’ statement after some googleing.
print(scrabble_score_v_1(new_word)) the course outputted an error
Your function fails on scrabble_score("pie" ). It returns "14" when it should return "5" with different values on ‘14’ while The Python 3.6.1 IDLE didn’t have any of these problems and printed everything as intended. After I tried the second solution the exercise became marked as solved and no longer this error appeared regardless of my attempt to reset the exercise, was that just an issue in the course interpreter?
new_word = input('Your word : ') def scrabble_score_v1(word): total =  for i in word.lower(): total.append(score[i]) return sum(total) scrabble_score_v1(new_word) def scrabble_score_v2(word): total = 0 for i in word.lower(): total += score[i] return total scrabble_score_v2(new_word) def scrabble_score_v3(word): total = 0 for i in word.lower(): total += score.get(i) return total scrabble_score_v3(new_word)