Last modified: Jan 10, 2023 By Alexander Williams
how to empty Array in python
example
1 2 3 4 5 6 7 8 | #array array = ['cat', 'dog', 'zebra'] #empty array array = [] #print array print(array) |
output
1 | []
|
cheking if array is empty
1 2 | if len(array) == 0: print('yes! array is empty') |
output
yes! array is empty