input: Write a python function that takes a string as input and returns its md5 hash as a string representation. If the input string is empty, the function should return None.
  assert generate_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'
  assert generate_md5('') == None
  assert generate_md5('A B C') == '0ef78513b0cb8cef12743f5aeb35f888'
  assert generate_md5('password') == '5f4dcc3b5aa765d61d8327deb882cf99'
output: def generate_md5(input_string):
      if input_string == '':
          return None
      import hashlib
      md5_hash = hashlib.md5(input_string.encode())
      return md5_hash.hexdigest()