新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:如何判斷python的數(shù)組是否為空
python中判斷一個列表是否為空,可以使用以下方法

創(chuàng)新互聯(lián)一直在為企業(yè)提供服務,多年的磨煉,使我們在創(chuàng)意設計,營銷型網(wǎng)站到技術(shù)研發(fā)擁有了開發(fā)經(jīng)驗。我們擅長傾聽企業(yè)需求,挖掘用戶對產(chǎn)品需求服務價值,為企業(yè)制作有用的創(chuàng)意設計體驗。核心團隊擁有超過10余年以上行業(yè)經(jīng)驗,涵蓋創(chuàng)意,策化,開發(fā)等專業(yè)領域,公司涉及領域有基礎互聯(lián)網(wǎng)服務綿陽機房托管、App定制開發(fā)、手機移動建站、網(wǎng)頁設計、網(wǎng)絡整合營銷。
1、is not None 判斷
列表不為空
list_1 = []
if list_1 is not None:
print('list is not none')列表為空
list_1 = []
if list_1[0] is None:
print('list_1 is none')2.if 列表判斷(更多學習內(nèi)容,請點擊Python學習網(wǎng))
列表不為空(空列表等于 False)
list_2 = []
if list_2:
print('list_2 is not none')3.length列表長度判斷
列表為空
list_3 = []
if len(list_3) == 0:
print('list_3 is none')list_3 = []
if len(list):
print('list_3 is not none') 本文題目:創(chuàng)新互聯(lián)Python教程:如何判斷python的數(shù)組是否為空
本文鏈接:http://www.fisionsoft.com.cn/article/cdcsoch.html


咨詢
建站咨詢
