1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
def toN(n, num=2):
res=[]
res2=''
while n>0:
n, tmp = divmod(n, num)
for i in range(len(res)):
return res2
print(toN(233, 2))
print(toN(233, 8))
print(toN(233, 16))
|
Reference: http://codingdojang.com/scode/458
'Programming Language > Python' 카테고리의 다른 글
BeautifulSoup을 이용한 파이썬 크롤링(Python Crawling with BeautifulSoup) (0) | 2019.11.24 |
---|---|
[Django] 우분투 18.04 LTS Django 설치 (0) | 2019.11.03 |
Python 순열(Permutation) (0) | 2019.10.09 |
Python itertools를 이용한 순열과 조합 (combinations, permutations) (0) | 2019.10.09 |
Python String copy (0) | 2019.10.09 |