Generate a Python program to edit a given string such that it reverses the words in the string.
string = 'This is a string'
def reverse_words(string):
    words = string.split(' ')
    reversed_words = words[::-1]
    reversed_string = ' '.join(reversed_words)
    return reversed_string