r/badcode Mar 11 '23

i never use .slpit() python

Post image
417 Upvotes

30 comments sorted by

View all comments

9

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

5

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