0 out of 464 challenges solved
Write a Python function `replace_spaces` that replaces all spaces in the given string with the sequence `'%20'`. #### Examples: ```python [main.nopy] replace_spaces("My Name is Dawood") # Output: 'My%20Name%20is%20Dawood' replace_spaces("I am a Programmer") # Output: 'I%20am%20a%20Programmer' replace_spaces("I love Coding") # Output: 'I%20love%20Coding' ```
def replace_spaces(string): """ Replace all spaces in the given string with '%20'. Args: string (str): The input string. Returns: str: The modified string with spaces replaced by '%20'. """ # Replace spaces with '%20' pass # Replace this line with your implementation