Write a program to reverse a string while preserving the positions of spaces.
Implement reverse_string(s), which accepts one string and returns the string in reverse order. Spaces are part of the character sequence and must appear wherever they occur after reversal.
def reverse_string(s):