Instantly share code, notes, and snippets.

Embed
What would you like to do?
list_2 = [] #create a blank to be populated list
for x in range(len(list_1)): # loop through the lenght of the original list
if list_1[x] == ' ': # if the value at that particular index is a blank space
list_2.append(x) # add the index to the new list
print(list_2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment