jjjj

hh

 

def generate_quiz_html(quiz_data): html = "

Quiz

" for i, (question, options, correct_answer) in enumerate(quiz_data, 1): html += f"

Question {i}: {question}

" for j, option in enumerate(options, 1): html += f"" html += f"
" html += "" return html quiz_data = [ ("What is 2+2?", ["3", "4", "5", "6"], 2), ("What is the capital of France?", ["Paris", "Berlin", "London", "Madrid"], 1), ("Who wrote Romeo and Juliet?", ["Shakespeare", "Dickens", "Austen", "Hemingway"], 1) ] quiz_html = generate_quiz_html(quiz_data) print(quiz_html)

Comments

Popular posts from this blog