input: Write a function to implement a Flask application that receives form data (Name, Email, Phone) and stores it in a SQLite database. If the insertion is successful, it should redirect to the homepage. If the given form data is empty, it should still attempt to store it.
  from flask import Flask, render_template, request, redirect
  import sqlite3
  
  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('/')
  	
  if __name__ == '__main__':
   app.run(debug=True)
  
  assert submit() == redirect('/')
  assert submit(name='John Doe', email='john@example.com', phone='1234567890') == redirect('/')
  assert submit(name='', email='', phone='') == redirect('/')
output: 
  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('/')
  