input: 
  def print_html_form_and_script():
      """
      This function generates a basic HTML form and a JavaScript function to submit a user's city 
      to the server when the form is submitted. The form is prevented from reloading the page 
      by using preventDefault() in the JavaScript function, and the data is sent to the server 
      using the fetch API.
  
      Example:
      print_html_form_and_script()
      Output:
      <form id="myForm" onsubmit="submitForm(event)">
        City:<br>
        <input type="text" name="city"><br>
        <input type="submit">
      </form>
  
      <script>
      function submitForm(event) {
        event.preventDefault();
  
        const form = document.getElementById('myForm');
        const city = form.querySelector('input[name="city"]').value;
  
        const data = { city: city };
  
        const options = {
          method: 'POST',
          body: JSON.stringify(data),
          headers: {
            'Content-Type': 'application/json'
          }
        };
  
        fetch('/my-api/submit-form', options)
          .then(response => response.json())
          .then(data => {
            console.log(data);
          });
      }
      </script>
      """
      html_form = '<form id="myForm" onsubmit="submitForm(event)">\n  City:<br>\n  <input type="text" name="city"><br>\n  <input type="submit">\n</form>'
      javascript_script = '''
  <script>
  function submitForm(event) {
    event.preventDefault();
  
    const form = document.getElementById('myForm');
    const city = form.querySelector('input[name="city"]').value;
  
    const data = { city: city };
  
    const options = {
      method: 'POST',
      body: JSON.stringify(data),
      headers: {
        'Content-Type': 'application/json'
      }
    };
  
    fetch('/my-api/submit-form', options)
      .then(response => response.json())
      .then(data => {
        console.log(data);
      });
  }
  </script>
  '''
      print(html_form)
      print(javascript_script)
  
output:     html_form = '<form id="myForm" onsubmit="submitForm(event)">\n  City:<br>\n  <input type="text" name="city"><br>\n  <input type="submit">\n</form>'
      javascript_script = '''
  <script>
  function submitForm(event) {
    event.preventDefault();
  
    const form = document.getElementById('myForm');
    const city = form.querySelector('input[name="city"]').value;
  
    const data = { city: city };
  
    const options = {
      method: 'POST',
      body: JSON.stringify(data),
      headers: {
        'Content-Type': 'application/json'
      }
    };
  
    fetch('/my-api/submit-form', options)
      .then(response => response.json())
      .then(data => {
        console.log(data);
      });
  }
  </script>
  '''
      print(html_form)
      print(javascript_script)