scrabble_score remove space error


#1

1      score = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2, 
2	         "f": 4, "i": 1, "h": 4, "k": 5, "j": 8, "m": 3, 
3	         "l": 1, "o": 1, "n": 1, "q": 10, "p": 3, "s": 1, 
4	         "r": 1, "u": 1, "t": 1, "w": 4, "v": 4, "y": 4, 
5	         "x": 8, "z": 10}
6	         
7	
8	entry = str(raw_input("What's your word?"))
9	
10	def scrabble_score(word):
11	    word = word.lower()
12	    points = 0
13	    str = [" ",",","*","."]
14	    for char in word:
15	        if char in str:
16	            word.remove(char)
17	        else:
18	            points += score[char]
19	    return points
20	
21	print scrabble_score(entry)

i want to remove the " " , but it shows error "AttributeError: 'str' object has no attribute 'remove'"

how to fix it ?


#2

How to answer it is more the question. Mods, please leave this question for code sample example.


#3

i mean when input like"sd vr,", need remove " " and ","


#4

We're not examining anything but [a-z]. There is no filtering beyond that.


#5

thank you for your answer