python十分簡單實現十進制到任意進制的轉換

1 def ten_to_sixteen(n,x): 2 a=[0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F'] 3 b=[] 4 while True: 5 s = n //x 6 y = n % x 7 b = b+[y] 8 if s == 0: 9
相關文章
相關標籤/搜索