Created
August 1, 2021 05:33
-
-
Save av1d/9586c3b7768c0be475e1caa18127c71c to your computer and use it in GitHub Desktop.
Remove all items in a list before/up to a specific string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dataset = ['0','3','03','vm','00','a','7'] | |
print("Unedited list: " + str(dataset)) | |
vm_index = dataset.index("vm") | |
for number in range(len(dataset)): | |
dataset.pop(0) | |
if dataset[0] == "vm": | |
break | |
print("Edited list: " + str(dataset)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment