input: Write a function to create a web application in Python using Flask that takes user input and generates an HTML page with the input. The function should define the Flask app and handle the routing for both GET and POST requests, rendering different templates based on the request method. If the request is a POST, it should retrieve the user input and display it in a result template; otherwise, it should display the initial index template. The function should return an instance of the Flask application.
  assert home()['template']=='index.html'
  assert home()['method']=='GET'
  assert home()['input']==None
  assert home()['output']==None
  
  assert home(method='POST', input_text='Hello')['template']=='result.html'
  assert home(method='POST', input_text='Hello')['method']=='POST'
  assert home(method='POST', input_text='Hello')['input']=='Hello'
  assert home(method='POST', input_text='Hello')['output']=="<html> <body> <h1>Your Input: </h1> <p>Hello</p> </body> </html>"
output: 
  def create_flask_app():
      from flask import Flask, request, render_template
  
      app = Flask(__name__)
  
      @app.route('/', methods=['GET', 'POST'])
      def home():
          if request.method == 'POST':
              input_text = request.form['input_text']
              return render_template('result.html', input_text=input_text)
          return render_template('index.html')
  
      return app
  