20190309
#################PYTHON########################
##Digital Convert
def mains(Num,unitNum): global countNum global flagNum while flagNum: if 0<Num<unitNum: numList.append(Num) flagNum = False elif Num == 0: flagNum = False break else: resNum = Num - unitNum countNum += 1 if resNum >= unitNum: Num = resNum continue elif resNum == 0: Num = countNum countNum = 0 numList.append(resNum) continue else: numList.append(resNum) Num = countNum countNum = 0 continue return numList
#Nun is inputed digital
#unitNum is the end-on system what you want to have convert
本文来自博客园,作者:pie_thn,转载请注明原文链接:https://www.cnblogs.com/pie-o/p/10503637.html