input: Write a function to create a web application in Python using Flask that will take user input and generate an HTML page with the input. The function should define the necessary routes and handle both GET and POST methods. If the method is POST, it should retrieve the input from the form and render it in a result.html template. If the method is GET, it should render an index.html template.
  
  
  from flask import Flask, render_template, request
  
  app = Flask(__name__)
  
  @app.route('/', methods=['GET', 'POST'])
  def home():
      if request.method == 'POST':
          input_text = request.form.get('input_text')
          return render_template('result.html', input_text=input_text)
      return render_template('index.html')
  
  if __name__ == '__main__':
      app.run(debug=True)
  
  
  // result.html file
  <html>
   <body>
    <h1>Your Input: </h1>
    <p>{{input_text}}</p>
   </body>
  </html>
  
  // index.html file (example)
  <html>
   <body>
    <form method="POST">
     <input type="text" name="input_text" placeholder="Enter your text here">
     <button type="submit">Submit</button>
    </form>
   </body>
  </html>
output: 
  @app.route('/', methods=['GET', 'POST'])
  def home():
      if request.method == 'POST':
          input_text = request.form.get('input_text')
          return render_template('result.html', input_text=input_text)
      return render_template('index.html')
  