input: Write a python function to create a new file and write data into it.
  assert write_data_to_file('testfile.txt', 'Hello, World!') == 'File created and data written successfully'
  assert write_data_to_file('sample.txt', 'Sample text content') == 'File created and data written successfully'
  assert write_data_to_file('data.txt', '12345') == 'File created and data written successfully'
output: def write_data_to_file(filename, data):
      try:
          with open(filename, 'w') as file:
              file.write(data)
          return 'File created and data written successfully'
      except Exception as e:
          return f'An error occurred: {e}'