Step 3: The Honesty Label چالش 3 از جلسهی 48، متوسط
honesty_label(parts): هر بخش یک (part, who) است و who یکی از "ai"، "me"، "both". بخشها را در دیکشنری groups جدا کن و چاپ کن:AI wrote: the answers in the chat, the page coloursI wrote: the handout, words() and score(), the attack testWe wrote together: the safe calculatorwritten only by me: 50 %
def honesty_label(parts):
groups = {"ai": [], "me": [], "both": []}
print("AI wrote:")
# ---- test (do not change) ----
honesty_label([
("the handout", "me"),
("words() and score()", "me"),
("the safe calculator", "both"),
("the answers in the chat", "ai"),
("the attack test", "me"),
("the page colours", "ai"),
])
راهنما و جواب این چالش · برگشت به درس جلسهی 48: پروژهی نهایی ۳: ارائه · چالش بعدی: Step 4: The Live Demo
بیشتر بخوان: تابع در پایتون: آموزش def، پارامتر و return با مثال