x = 100 # int y = str(x) # 将整型转换为字符串 print(type(y)) # <class 'str'> a = "100" # 必须是纯字符串,"100yu"不可以 b = int(a) print(type(b)) # <class 'int'>