Skip to content

Instantly share code, notes, and snippets.

@trivial-search
Created February 4, 2018 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trivial-search/7c4e5ef23e452a7724c5b0a34f902c16 to your computer and use it in GitHub Desktop.
Save trivial-search/7c4e5ef23e452a7724c5b0a34f902c16 to your computer and use it in GitHub Desktop.
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