摘要:
num = int(input('请输入一个整数:')) s = '' def int_to_str(val): li = [] while val > 0: digit = val % 10 li.append(digit) val //= 10 return li lst = int_to_str(num) for i ... 阅读全文
摘要:
num = '654321' def str_to_int(str): val = 0 for ch in str: val *= 10 val += ord(ch) - ord('0') return val print(str_to_int(num), type(str_to_int(num))) # 654321 阅读全文