[tryhelloworld] 같은 수는 싫어 by파이썬


[tryhelloworld] 같은 수는 싫어 by파이썬

문제no_continuous함수는 스트링 s를 매개변수로 입력받습니다. s의 글자들의 순서를 유지하면서, 글자들 중 연속적으로 나타나는 아이템은 제거된 배열(파이썬은 list)을 리턴하도록 함수를 완성하세요.예를들어 다음과 같이 동작하면 됩니다. s가 '133303'이라면 ['1', '3', '0', '3']를 리턴s가 '47330'이라면 [4, 7, 3, 0]을 리턴 나의 답123456789101112def no_continuous(s): result_list = [] for i in range( len(s) ) : if i == 0: result_list.append(s[i]) elif s[i] != s[i-1]: result_list.append(s[i]) return result_list # 아래..


원문링크 : [tryhelloworld] 같은 수는 싫어 by파이썬