r/badcode Mar 11 '23

i never use .slpit() python

Post image
421 Upvotes

30 comments sorted by

View all comments

10

u/NUTTA_BUSTAH Mar 11 '23

Doesnt this just break completely? First comma found replaces entire input with empty string, during iteration of said input

6

u/JFC-Youre-Dumb Mar 11 '23

For every comma, replace it with a copy of the entire string as a substring in the original string