Bootstrap FreeKB - Python (Scripting) - Blank out a list
Python (Scripting) - Blank out a list

Updated:   |  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 Buy Me A Coffee



Comments


Add a Comment


Please enter bdf267 in the box below so that we can be sure you are a human.