input: Write a python function to encode a string in base64 format.
  assert encode('This is a test string') == 'VGhpcyBpcyBhIHRlc3Qgc3RyaW5n'
  assert encode('Hello World') == 'SGVsbG8gV29ybGQ='
  assert encode('Python Programming') == 'UHl0aG9uIFByb2dyYW1taW5n'
output: def encode(input_string):
      import base64
      encoded_bytes = base64.b64encode(input_string.encode('utf-8'))
      return encoded_bytes.decode('utf-8')