日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

python菜鸟教程split_Python split()方法

發(fā)布時(shí)間:2023/12/1 python 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python菜鸟教程split_Python split()方法 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

網(wǎng)頁地址解析:

#coding=utf-8

str="http://www.runoob.com/python/att-string-split.html"

print("0:%s"%str.split("/")[-1])

print("1:%s"%str.split("/")[-2])

print("2:%s"%str.split("/")[-3])

print("3:%s"%str.split("/")[-4])

print("4:%s"%str.split("/")[-5])

print("5:%s"%str.split("/",-1))

print("6:%s"%str.split("/",0))

print("7:%s"%str.split("/",1))

print("8:%s"%str.split("/",2))

print("9:%s"%str.split("/",3))

print("10:%s"%str.split("/",4))

print("11:%s"%str.split("/",5))

結(jié)果是:

0:att-string-split.html

1:python

2:www.runoob.com

3:

4:http:

5:['http:', '', 'www.runoob.com', 'python', 'att-string-split.html']

6:['http://www.runoob.com/python/att-string-split.html']

7:['http:', '/www.runoob.com/python/att-string-split.html']

8:['http:', '', 'www.runoob.com/python/att-string-split.html']

9:['http:', '', 'www.runoob.com', 'python/att-string-split.html']

10:['http:', '', 'www.runoob.com', 'python', 'att-string-split.html']

11:['http:', '', 'www.runoob.com', 'python', 'att-string-split.html']

David

David

183***971@qq.com3年前 (2018-03-14)

總結(jié)

以上是生活随笔為你收集整理的python菜鸟教程split_Python split()方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。