input: Write a function that creates a Flask application to accept form submissions with fields Name, Email, and Phone, and stores the submitted data in a SQLite database. The function should return the Flask application object. The application should have a route for the home page where the form is displayed and another route to handle form submissions via a POST request.
  from flask import Flask, render_template, request, redirect
  import sqlite3
  
  def create_flask_app():
   app = Flask(__name__)
  
   @app.route('/')
   def home():
    return render_template('index.html')
  
   @app.route('/submit', methods=['POST'])
   def submit():
    name = request.form.get('name')
    email = request.form.get('email')
    phone = request.form.get('phone')
    
    conn = sqlite3.connect('data.db')
    cur = conn.cursor()
    
    cur.execute("INSERT INTO data (name, email, phone) VALUES (?, ?, ?)", (name, email, phone))
    conn.commit()
    
    return redirect('/')
  	
   return app
  
  # Test cases
  assert callable(create_flask_app) == True
  from flask_testing import TestCase
  
  class TestFlaskApp(TestCase):
   def create_app(self):
    return create_flask_app()
  
   def test_home_route(self):
    response = self.client.get('/')
    self.assertEqual(response.status_code, 200)
  
   def test_submit_route(self):
    response = self.client.post('/submit', data={
     'name': 'John Doe',
     'email': 'john@example.com',
     'phone': '1234567890'
    })
    self.assertEqual(response.status_code, 302)
output: 
  def create_flask_app():
   app = Flask(__name__)
  
   @app.route('/')
   def home():
    return render_template('index.html')
  
   @app.route('/submit', methods=['POST'])
   def submit():
    name = request.form.get('name')
    email = request.form.get('email')
    phone = request.form.get('phone')
    
    conn = sqlite3.connect('data.db')
    cur = conn.cursor()
    
    cur.execute("INSERT INTO data (name, email, phone) VALUES (?, ?, ?)", (name, email, phone))
    conn.commit()
    
    return redirect('/')
  	
   return app
  