Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
semiinfinitely
· 8mo ago · 0 comments
your second function is the type of bad code you get from people trying to program python like its c
Comments
[–]
ktm5j
8mo ago
Is there a pythonic way to satisfy the prompt? IE without making a new list?
[–]
nomel
8mo ago
https://news.ycombinator.com/item?id=47652757
[–]
wwfn
8mo ago
Absolutely! And the list.pop version is multiple orders of magnitude slower. But I took the prompt to be asking for in-place modification of the existing list. Comprehension does not do that.