Scrabble_score - none error


I am newbie to python and when i try to try this exercise i am getting an error Your function fails on scrabble_score(“pie”). It returns “None” when it should return “5”. Please let me know what is wrong, when i try in pycharm it does not display any none .

def scrabble_score(word):
  for i in word:
    i = i.lower()
    if i in score.keys():
      result += score[i]
  print result

Thanks in advance


got it , i added return result . although i still did not understand why it worked in pycharm


Print and return do very different things, donut also delends on your definition of working


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