Scrabble_score - none error


#1

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):
  result=0
  for i in word:
    i = i.lower()
    if i in score.keys():
      result += score[i]
  print result

Thanks in advance


#2

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


#3

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


#4

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