新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
創(chuàng)新互聯(lián)Python教程:python判斷列表是否為空
is not None 判斷

創(chuàng)新互聯(lián)建站網(wǎng)站建設(shè)公司是一家服務(wù)多年做網(wǎng)站建設(shè)策劃設(shè)計(jì)制作的公司,為廣大用戶(hù)提供了網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè),成都網(wǎng)站設(shè)計(jì),廣告投放平臺(tái),成都做網(wǎng)站選創(chuàng)新互聯(lián)建站,貼合企業(yè)需求,高性?xún)r(jià)比,滿(mǎn)足客戶(hù)不同層次的需求一站式服務(wù)歡迎致電。
列表不為空
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')if 列表判斷
列表不為空(空列表等于 False)
list_2 = []
if list_2:
print('list_2 is not none')length列表長(zhǎng)度判斷
列表為空
list_3 = []
if len(list_3) == 0:
print('list_3 is none')list_3 = []
if len(list):
print('list_3 is not none') 網(wǎng)站欄目:創(chuàng)新互聯(lián)Python教程:python判斷列表是否為空
網(wǎng)站網(wǎng)址:http://www.dlmjj.cn/article/cdiocjs.html


咨詢(xún)
建站咨詢(xún)
