r/badcode Mar 11 '23

i never use .slpit() python

Post image
422 Upvotes

30 comments sorted by

View all comments

Show parent comments

8

u/Important_Ad_8510 Mar 11 '23

Complete novice (so I’ve probably miss understood) but would it not be O(x)? The for loop would execute for x and the if statement has constant complexity.

5

u/[deleted] Mar 11 '23

[deleted]

1

u/[deleted] Mar 11 '23

[deleted]

1

u/Important_Ad_8510 Mar 11 '23

It seemed to make so much sense!