human
Write a function to replace all spaces in the given string with '%20'. Here is a solution in Python:
Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
 def replace_spaces(string):
  return string.replace(" ", "%20")