Strings In Depth9 / 19
Up next

Replace text

s = "a-b-c-d"
print(s.replace("-", "_"))       # all
print(s.replace("-", "_", 2))    # first two
What you're solving

replace all, or the first n