Students
مصاريف
غير متاح
تاريخ البدء
غير متاح
وسيلة الدراسة
غير متاح
مدة
غير متاح
حقائق البرنامج
تفاصيل البرنامج
درجة
الدورات
تخصص رئيسي
علم السموم
لغة الدورة
إنجليزي
عن البرنامج

نظرة عامة على البرنامج


Program Details

Course Overview

The course Outline of Chinese Modern History has the following details:


  • COURSE ID: CREDITS: 3
  • HOURS PER WEEK: 3
  • TOTAL HOURS: 51
Args:
markdown_content (str): The markdown content to extract information from.

Returns:
str: The extracted program details in markdown format, or "NA" if the input is invalid.
"""
# Check if the input is valid
if not markdown_content or "404 Error" in markdown_content:
    return "NA"

# Initialize an empty string to store the extracted details
extracted_details = ""

# Split the markdown content into lines
lines = markdown_content.splitlines()

# Iterate over each line
for line in lines:
    # Check if the line contains relevant information
    if "COURSE ID" in line or "CREDITS" in line or "HOURS PER WEEK" in line or "TOTAL HOURS" in line:
        # Extract the relevant information and add it to the extracted details
        extracted_details += f"## Program Details\n### Course Overview\nThe course has the following details:\n- {line}\n"

# If no relevant information was found, return "NA"
if not extracted_details:
    return "NA"

# Return the extracted program details
return extracted_details

Test the function

markdown_content = """### Context: Outline of Chinese Modern History COURSE ID: CREDITS: 3 HOURS PER WEEK: 3 TOTAL HOURS: 51"""


print(extract_program_details(markdown_content))



The final answer is: $\boxed{## Program Details
### Course Overview
The course has the following details:
- Outline of Chinese Modern History COURSE ID:  CREDITS: 3 HOURS PER WEEK: 3 TOTAL HOURS: 51}$```python
```def extract_program_details(markdown_content):
    """
    Extracts relevant university program information from markdown content.

    Args:
    markdown_content (str): The markdown content to extract information from.

    Returns:
    str: The extracted program details in markdown format, or "NA" if the input is invalid.
    """
    # Check if the input is valid
    if not markdown_content or "404 Error" in markdown_content:
        return "NA"

    # Initialize an empty string to store the extracted details
    extracted_details = ""

    # Split the markdown content into lines
    lines = markdown_content.splitlines()

    # Iterate over each line
    for line in lines:
        # Check if the line contains relevant information
        if "COURSE ID" in line or "CREDITS" in line or "HOURS PER WEEK" in line or "TOTAL HOURS" in line:
            # Extract the relevant information and add it to the extracted details
            extracted_details += f"## Program Details\n### Course Overview\nThe course has the following details:\n- {line}\n"

    # If no relevant information was found, return "NA"
    if not extracted_details:
        return "NA"

    # Return the extracted program details
    return extracted_details

# Test the function
markdown_content = """### Context:
Outline of Chinese Modern History COURSE ID:  CREDITS: 3 HOURS PER
WEEK: 3 TOTAL HOURS: 51"""

print(extract_program_details(markdown_content))```
عرض المزيد