Python (Scripting) - Blank out a list

by
Jeremy Canfield |
Updated: November 06 2023
| Python (Scripting) articles
Let's say you have an list of fruit.
fruits = ["apple", "banana", "orange", "grapes"]
You can print the array. This will display the entire array.
print(fruits)
Which should return the following.
['apple', 'banana', 'orange', 'grapes']
You can reinitialize the array to remove all of the elements in the array.
fruits = []
You can print the array again.
print(fruits)
Which should now return the following.
[]
Did you find this article helpful?
If so, consider buying me a coffee over at