Int -> List | List -> Int _ CodingPark程式設計公園

TEAM-AG發表於2020-10-05

Int -> List

num = 123
list_x = [int(i) for i in str(num)]

List -> Int

def toInt(i):
    num = 0
    for a in i:
        num = int(a) + num * 10
    # print("gogo...: "+str(num))
    return num

在這裡插入圖片描述

相關文章