def remove_duplicates(lst):new_lst = []for c in lst:if c not in new_lst:new_lst.append(c)print new_lstreturn new_lstremove_duplicates([1,1,2,2])리스트와 if not in 의 신세계!!
'codeacademy' 카테고리의 다른 글
| 16. Exam Statistics (0) | 2017.03.28 |
|---|---|
| 15. Practice Makes Perfect / median (0) | 2017.03.28 |
| 15. Practice Makes Perfect / censor (0) | 2017.03.28 |
| 15. Practice Makes Perfect / scrabble_score (0) | 2017.03.28 |
| 15. Practice makes Perfect / anti_vowel (0) | 2017.03.28 |
댓글