1 2 3 4 5 6 7 8 9 | def censor(text,word): if word in text: new_text = text.replace(word,"*" *len(word)) print new_text return new_text censor("this hack is wack hack", "hack") | cs |
'codeacademy' 카테고리의 다른 글
| 15. Practice Makes Perfect / median (0) | 2017.03.28 |
|---|---|
| 15. Practice Makes Perfect / remove_duplicates (0) | 2017.03.28 |
| 15. Practice Makes Perfect / scrabble_score (0) | 2017.03.28 |
| 15. Practice makes Perfect / anti_vowel (0) | 2017.03.28 |
| 15. Practice Makes Perfect / reverse (0) | 2017.03.28 |
댓글