剥离小数点的浮点数
为什么不可能将小数点从浮子上剥离?
str(1.5).strip(“。”)
返回1.5
为什么不返回15
?
小数点是否与完整的stop 。
不等的符号?
Why isn't it possible to strip the decimal point off of a float?
str(1.5).strip(".")
returns 1.5
Why doesn't it return 15
?
Has the decimal point an own symbol that is not equal with the full stop .
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
str.Strip()
仅在开始和结束时删除字符,而不在中间。它主要用于在一系列输入周围删除外部空格(没有参数,默认为删除空格)。使用
str.replace()
在任何地方替换字符串:str.strip()
only removes characters at the beginning and end, not in the middle. It's mostly used for removing extraneous whitespace around a line of input (with no argument, it defaults to removing whitespace).Use
str.replace()
to replace a string anywhere: