python如何将数字改变成字符串

2026-02-12 09:10:37

1、num=322

str='%d'%num

str就已经转变为字符串数据

2、也可使用‘’+ num

将数字型转变为字符串类型

3、可使用type(num)

来查看类型

猜你喜欢