بتل کد Battle Codeدارد باز می‌شود…

Checked Quiz Questions چالش 6 از جلسه‌ی 9، سخت

برای بازی مسابقه‌ی جلسه‌ی ۱۲، هوش مصنوعی پنج سؤال و جواب پیشنهاد داده (candidates). فقط آن‌هایی را نگه دار که جوابشان با book یکی است (اگر سؤال در کتاب نیست، book.get(q) جواب None می‌دهد و نگهش نمی‌داری). اول چاپ کن kept 3 of 5، بعد هر سؤال نگه‌داشته را در یک خط به شکل سؤال = جواب.

book = {
    "Is there a Nobel Prize in mathematics?": "no",
    "Should you share your password with a chat bot?": "no",
    "Can AI make up facts?": "yes",
}
candidates = [
    ("Is there a Nobel Prize in mathematics?", "yes"),
    ("Should you share your password with a chat bot?", "no"),
    ("Can AI make up facts?", "yes"),
    ("Does AI always tell the truth?", "yes"),
    ("Is there a Nobel Prize in mathematics?", "no"),
]
kept = []

راهنما و جواب این چالش · برگشت به درس جلسه‌ی 9: توهم: با اطمینان غلط می‌گوید

بیشتر بخوان: دیکشنری در پایتون: آموزش کامل کلید و مقدار با مثال