python:实现字符串转数字
可以使用 Python 的内置函数 int() 来将字符串转换为数字,比如:
string = "123"
number = int(string)
print(number)
这将输出数字 123。
该博文为原创文章,未经博主同意不得转载。
本文章博客地址:https://cplusplus.blog.youkuaiyun.com/article/details/130059213
string = "123"
number = int(string)
print(number)
这将输出数字 123。
该博文为原创文章,未经博主同意不得转载。
本文章博客地址:https://cplusplus.blog.youkuaiyun.com/article/details/130059213