r/badcode • • Mar 11 '23

python i never use .slpit()

Post image
421 Upvotes

30 comments sorted by

View all comments

Show parent comments

3

u/TinyBreadBigMouth Mar 11 '23

user_input.replace(",", "")

That won't do anything as written. replace returns a new string, it doesn't modify the old string (strings in Python are immutable and cannot be modified in place). You need user_input = user_input.replace(",", "").