The replace() method substitutes every occurrence of one substring with another. Put the substring to find first and the replacement substring second, separated by a comma. section 8.1
Replace spaces with underscores
"variables have no spaces".replace(" ", "_") evaluates to "variables_have_no_spaces". The first argument is the text to find; the second is the text inserted in its place. section 8.1
Try these quick checks with a = "Raining in the spring time.":
- a.replace("R", "r") changes the initial capital letter. section 8.1
- a.replace("ing", "") removes each matching occurrence. section 8.1
- b = a.replace("time", "tiempo") stores the changed string in b. section 8.1




