Assume I have a list:
myl = [1, 2, 3, 4, 5, 4, 4, 4, 6]
What is the most efficient and simplest pythonic way of in-place (double emphasis) replacement of all occurrences of 4
with 44
?
I'm also curious as to why there isn't a standard
way of doing this (especially, when strings
have a not-in-place replace
method)?