“Elemen daftar delete python” Kode Jawaban

Elemen daftar delete python

# Deleting list items
my_list = ['p', 'r', 'o', 'b', 'l', 'e', 'm']

# delete one item
del my_list[2]

print(my_list)

# delete multiple items
del my_list[1:5]

print(my_list)

# delete the entire list
del my_list

# Error: List not defined
print(my_list)
SAMER SAEID

cara menghapus seluruh daftar dalam python

thislist = ["apple", "banana", "cherry"]
print(thislist)
del thislist
print(thislist)
Programmer of empires

Jawaban yang mirip dengan “Elemen daftar delete python”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya