TEAMLAB-Lecture / python-101-for-data-science-by-pknu

1 stars 14 forks source link

goflowwith binary_converter 관련 질문 #26

Open 202211304KJH opened 2 years ago

202211304KJH commented 2 years ago

` result = None a = decimal_number b = [] while a > 0 : b.append(str(a %2)) a = int(a/2) b.reverse() x = (''.join(b)) print(x) result = str(x) print(result)

==================================

return result `

decimal_number 를 100으로 지정하고 실행하였더니 1100100 값이 나옵니다. str으로 바꾸었는데 '1100100'이 출력 안되고 1100100이 출력되는 이유가 무엇인지 궁금합니다ㅠ