I am trying to create an array and then clear it using a function, but the terminal keeps displaying 'list index out of range'.
duplicates = []
def ClearArray():
for index in range(100):
duplicates[index].append("")
ClearArray()
print(duplicates)
The instruction is to Initialise the global array Duplicates, which is a 1D array of 100 elements of data type STRING, and set all elements to empty string using a function.