from bs4 import BeautifulSoup def evaluate_html(content): score = 0 feedback = [] soup = BeautifulSoup(content, 'html.parser') if soup.html: score += 1 else: feedback.append("Missing tag") if soup.head and soup.title: score += 1 else: feedback.append("Missing or ") if soup.body: score += 1 else: feedback.append("Missing <body>") tags = ['p', 'h1', 'href', 'h2', 'img', 'a', 'table'] used = [tag for tag in tags if soup.find(tag)] if len(used) >= 3: score += 1 else: feedback.append("Use at least 3 different HTML tags") if len(soup.text.strip()) > 20: score += 1 else: feedback.append("Content too short") return score, feedback