😎코딩테스트 연습>월간 코드 챌린지 시즌1>이진 변환 반복하기
def solution(s):
cnt_0 = 0
cnt_num = 0
while s != '1':
cnt_0 += s.count("0")
s = s.replace("0", "")
s = str(format(len(s), 'b'))
cnt_num += 1
return [cnt_num, cnt_0]
십진수 -> 이진수
format(int_num, 'b')
앞에 문자를 떼고 숫자만 반환