r/CodingHelp • u/[deleted] • Apr 03 '21
[Python] How to remove values in a list?
I have two lists, one called owners and one called uaids, both with numbers. The list "users" contains a few values with "None" in it, however, this code doesn't seem to get rid of any of the values for some reason. Why doesn't it work?
for x in range(len(owners)):
if owners[x] == "None":
owners.pop[x]
uaids.pop[x]
16
Upvotes
2
Apr 03 '21 edited Aug 31 '25
[removed] ā view removed comment
1
Apr 04 '21
Doesn't work because I need it to remove the corresponding index value in a different list to keep them synchronized.
2
u/Endercheif Advanced Coder Apr 03 '21
.pop(i)