python中的异常拆分

2024-06-01 01:13:55 发布

您现在位置:Python中文网/ 问答频道 /正文

Mt. Everest is the highest peak in the world. It's height is 8848 m. 

我怎么把它分成两句话?除了“Mt”之外,不在点上分开吗?规则是,只要Mt后面跟一个点,它就需要跳过它。在

像这样:

^{pr2}$

目前为止的代码

data = "Mt. Everest is the highest peak in the world. It's height is 8848 m."
sentences=data.split(".")
print (sentences)

Tags: the代码inworlddatais规则sentences