[英]Python Array Question(Programming)
[]是什么意思? 另外如何在python中將變量標識為空數組? 謝謝!
perl: xcoords = ()
我該如何翻譯?
[]-在Python中是一個空列表,與調用list()相同,例如[] == list()要檢查列表是否為空,可以使用len(l)或:
listV = [] # an empty list
if listV:
# do something if list is not empty
else:
# do something if list is really empty
要了解有關列表的更多信息,可以使用以下鏈接
列表就像C ++數組,但有所不同。 區別之一是它們可以控制不同類型的列表。 檢查列表是否為空
lists = []
len(lists)
lists[0]= "More of me"
len(lists)
更多檢查Python官方教程及以上文檔
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.