array[:-1] #列出-1之前的 [1, 2, 5, 3, 6, 8]

array[:-1] #列出-1之前的

[1, 2, 5, 3, 6, 8]

为甚麽不包括0啊

八月长安就是二熊
浏览 2067回答 6
6回答

蜂之谷

倒数第一个之前所有的元素哪来的0

慕瓜9220888

FKIAJJVSYVQVAJLLOIGXWQJTAGGYNWPEVDUOTIHMYVCABYCSRGNAKUFKJSEBSKLJXACVUEOYOSBKNAXXRVNPPRYXXYWATSYBYMMKIBKWJGAKQYXGVJRJUREXZCSJDNSHMLBOYPPVJMVKHHOFLTVORRFFBMAJSTAXDUPFBQCVYIMNFEDGNUOOQIHQPPWYSLREDVMNAKZNCLKBICZPUTIREVVMZXCBKQGQBSAZOOBOVXBUUMEKRYICQJTMDAGRDZZERLFCCYMFHQXORLFXWCLSFPZDRAZYFUVLPHKJLCCMNKIKAPGWQHNLYIRSIJGWBETMJTDUAOAXQDAXOKIBKCRIZPMMLENNUUBMQPYOLLLCJRDMFMTQSIJSLXXOXHPNMHAAXIGQKNYNGQCSHSUSKATSBBSUBMWCVRZASEJFVWJTOXINADGPOPRGIVLOKSTETFQMJMCUCNCEHKJZAYAZZIRUHFBGRREHQOPYDFDDDTDFDFUHGDETKCIWQDZPNHZIQIIEEPQYFEHHKUZASUJMBLYHYGLVYSPOJOKIEHHDDXHZOFIUKRUBFUGWPLLOFHGOXKXGXEQVNGJCCDFKAPWWQKABAFEXKKQTUTBAJWPZVWRENTZSFUOSNJSVLOMTBQCCVRBBCEWLOHHKTEWVHRRFMEONHSZYBLALCNCZIBBSJLDMPSLYUODZEHDNXESKWVORSVTGSXJISVRQBTIADCJIIQRTSXDGTLJLFATGQGPXPHPVILFRSHCBYSFYWHWHGJVNUSQBQCNWDMGBPRTZCMMBMETBEEAKJVAWEUNAAGXTITTOBKBFRGREKDKFAMHNDDPFIMRDYLIOUTHMLJTHBOSGSKZCVVRIPXGRYRNDLJLQRHATWGOQSKJERRQRMINGSBYGHQJYXDTNIJVJLQQGGRZHJYVUHKWAVITTJPWHOTFXNADWWUPESLRAXUFHFBXNAKNIXPRAQTGKYASXDWDGXOAFXQMZMINSSKDGZDCCPAWWIPVHQZXTCSFBAVACEEQJZJUWBAJQJPFWBDVLHXMOLKGVEHSFTRDLQWVRBGZOPHXXXHHRTLQJTPFECDCADQWTCJVTVIOHBRSXZKRFFVJVKNPYOSBFPFIHDGAWFGYAVIRUBIGLHZVVSYALTBQTCOUYWIDPSBZFHZXTBVLRSUFRMHCWMIQEDFGWPYYSXFLWQWWFPAJEMCSFPDSEQJAXZJEDSHDWSFYHSKLGQJMPRVKWRERRXGDVXWTCPSKHNYURAAYAUFRGHHRARYAVQQXGMARMEWWGQDQRAOAABOLPCMZRTAHEUFWPLYFSQJINKCDORQJWNGZKHVDHFISIFTRKWUVLKHOBZMMZJVVMAXZKTQSPCTNJBONWDEBTLDWFMTQQCFUJFOCPPZXLVEDANUELLVEMGAELPXAJLKUYSKPOXWXKKEYURACTKHLCUWPGUQHIIZCLKKBUXUMFEXEBLVQWZOHYEFVUJLBUKBILTEQPOLCWQPTCSBELMGVDLEDEJQNYQJBKHYMNMLTJLCQXNSKNPYFFZKLZSLUKRRSYWFYHGQQKWYHQPMMDNVVGBZPKRUFUQPRISIFTHXGYLJPQWLHGZMOCIDSIRANEUEDDGPOOFPQSUPPHULXX

wangaaty

python的分片操作,该命令不是列出-1之前的内容,而是从第0个引索到倒数第一个引索之前的元素

慕粉2014408783

原始的列表什么样?包括0了么?
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python