2018年12月24日 星期一

Python List


my_list = list()
my_list.append(12)
print ("my_list.append(12)")
print (my_list)

my_list.extend([1,2,3,4])
print ("my_list.extend([1,2,3,4])")
print (my_list)

my_list.remove(1)
print ("my_list.remove(1)")
print (my_list)

del my_list[0]
print ("del my_list[0]")
print (my_list)

my_list.append(12)                                                                                                      
[12]                                                                                                                    
my_list.extend([1,2,3,4])                                                                                               
[12, 1, 2, 3, 4]                                                                                                        
my_list.remove(1)                                                                                                       
[12, 2, 3, 4]                                                                                                           
del my_list[0]                                                                                                          
[2, 3, 4]                                                                                                               
                                                                                                                        
                                                                                                                        
...Program finished with exit code 0                                                                                    

======== RESTART: D:/數值分析/PYTHON/others/oth-1.py ============
my_list.append(12)
[12]
my_list.extend([1,2,3,4])
[12, 1, 2, 3, 4]
my_list.remove(1)
[12, 2, 3, 4]
del my_list[0]
[2, 3, 4]
>>>

沒有留言:

張貼留言

113 學年度第 1 學期 RFID應用課程 Arduino程式

113 學年度第 1 學期 RFID應用課程 Arduino程式 https://www.mediafire.com/file/zr0h0p3iosq12jw/MFRC522+(2).7z/file 內含修改過後的 MFRC522 程式庫 (原程式有錯誤) //定義MFRC522...