input: Write a python function to create a post, get all posts, and get a single post by ID using Flask.
  assert create_post({"title": "First Post", "content": "This is my first post"}) == {"id": 1, "title": "First Post", "content": "This is my first post"}
  assert get_posts() == [{"id": 1, "title": "First Post", "content": "This is my first post"}]
  assert get_post(1) == {"id": 1, "title": "First Post", "content": "This is my first post"}
output: from flask import Flask, jsonify, request
  
  app = Flask(__name__)
  
  posts = []
  next_id = 1
  
  def create_post(post):
      global next_id
      post['id'] = next_id
      posts.append(post)
      next_id += 1
      return post
  
  def get_posts():
      return posts
  
  def get_post(post_id):
      for post in posts:
          if post['id'] == post_id:
              return post
      return None
  
  @app.route('/posts', methods=['POST'])
  def create_post_route():
      new_post = request.json
      created_post = create_post(new_post)
      return jsonify(created_post), 201
  
  @app.route('/posts', methods=['GET'])
  def get_posts_route():
      return jsonify(get_posts())
  
  @app.route('/posts/<int:post_id>', methods=['GET'])
  def get_post_route(post_id):
      post = get_post(post_id)
      if post:
          return jsonify(post)
      else:
          return jsonify({"error": "Post not found"}), 404
  
  if __name__ == '__main__':
      app.run()