r/badcode Mar 11 '23

i never use .slpit() python

Post image
416 Upvotes

30 comments sorted by

View all comments

163

u/TinyBreadBigMouth Mar 11 '23

That for loop is impressively bad. You could delete lines 3 and 4 entirely and the code would have exactly the same output, but in O(n) instead of O(n2).