add task reschedule for this code
import datetime
import heapq
# Initialize an empty list to store tasks
tasks = []

def add_task():
    title = input("Enter task title: ")
    description = input("Enter task description: ")
    due_date = input("Enter due date (YYYY-MM-DD): ")
    priority = input("Enter priority (high, medium, low): ")

    task = {
        'title': title,
        'description': description,
        'due_date': due_date,
        'priority': priority,
        'completed': False
    }

    tasks.append(task)
    print("Task added successfully!")

def display_upcoming_tasks():
    today = datetime.date.today()
    upcoming_tasks = [task for task in tasks if not task['completed'] and task['due_date'] >= str(today)]
    if upcoming_tasks:
        print("Upcoming tasks:")
        for idx, task in enumerate(upcoming_tasks, start=1):
            print(f"{idx}. Title: {task['title']}, Due Date: {task['due_date']}, Priority: {task['priority']}")
    else:
        print("No upcoming tasks found.")

def mark_task_as_completed():
    display_upcoming_tasks()
    task_index = int(input("Enter the task number to mark as completed: ")) - 1
    if 0 <= task_index < len(tasks):
        tasks[task_index]['completed'] = True
        print(f"Task '{tasks[task_index]['title']}' marked as completed.")
    else:
        print("Invalid task number.")

def main():
    while True:
        print("\nTask Scheduler Menu:")
        print("1. Add Task")
        print("2. Display Upcoming Tasks")
        print("3. Mark Task as Completed")
        print("4. Quit")
        
        choice = input("Enter your choice (1/2/3/4): ")
        
        if choice == '1':
            add_task()
        elif choice == '2':
            display_upcoming_tasks()
        elif choice == '3':
            mark_task_as_completed()
        elif choice == '4':
            break
        else:
            print("Invalid choice. Please try again.")

if __name__ == "__main__":
    main()