Skip to content

Instantly share code, notes, and snippets.

@Cyril-Pop
Created August 10, 2020 08:10
Show Gist options
  • Save Cyril-Pop/54b693a15418832c3b3005183f2e5054 to your computer and use it in GitHub Desktop.
Save Cyril-Pop/54b693a15418832c3b3005183f2e5054 to your computer and use it in GitHub Desktop.
lstvar = ["A","B","C","","","D","F","","G","","",""]
newlst =[]
for x in lstvar:
if x != "":
newlst.append(x)
else:
newlst.append(newlst[-1])
print newlst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment