String Element Replacement

Learn to replace specific characters in a string using Python's str.replace() function.

String manipulation, such as changing case, substituting characters, etc., is a typical task in Python programming. The `str.replace()` function is especially useful for substituting specific characters or substrings within a string. Your task is to write a function called `substitute_characters()` that takes the string `input_str` as a parameter and replaces all occurrences of "0" with "O". For example, the string "L0ND0N" should be transformed to "LONDON". ### Parameters - `input_str` (str): The string to be manipulated. ### Return Value - The function should return the resulting string after all "0"s have been replaced with "O"s. ### Examples ```python # The string "L0ND0N" becomes "LONDON" after replacing "0" with "O" substitute_characters("L0ND0N") # Returns: "LONDON" # The string "DUBL0N" becomes "DUBLON" after the operation substitute_characters("DUBL0N") # Returns: "DUBLON" ``` ```