Skip to content

Instantly share code, notes, and snippets.

@Cyril-Pop
Created August 10, 2020 08:12
Show Gist options
  • Save Cyril-Pop/ff8591d01fdc0246260f3bdae4c4a38b to your computer and use it in GitHub Desktop.
Save Cyril-Pop/ff8591d01fdc0246260f3bdae4c4a38b to your computer and use it in GitHub Desktop.
complete Py
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