Step 6: The Full Report چالش 6 از جلسهی 71، سخت
همه را به هم وصل کن. تابعِ report(name, done, times) را بنویس: times دیکشنریای است از شمارهی قدم به زمانِ انجامش. گزارش را اینطور چاپ کن: خطِ اول INCIDENT REPORT: hacked account؛ بعد برای هر قدمِ انجامشده 09:40 [contain] change the password from a clean device و برای قدمِ انجامنشده --:-- [learn] write what happened and when (pending)؛ در پایان done 4 of 5 و اگر چیزی مانده بود next: [learn] write what happened and when. بعد report("hacked account", {1, 2, 3, 4}, {1: "09:40", 2: "09:41", 3: "09:55", 4: "10:10"}) را صدا بزن.
PLAYBOOK = {
"hacked account": [
("contain", "change the password from a clean device"),
("contain", "sign out all devices"),
("recover", "turn on 2FA"),
("recover", "tell friends to ignore messages from you"),
("learn", "write what happened and when"),
],
}
def report(name, done, times):
pass
report("hacked account", {1, 2, 3, 4}, {1: "09:40", 2: "09:41", 3: "09:55", 4: "10:10"})
راهنما و جواب این چالش · برگشت به درس جلسهی 71: پروژه: دفترچهی حادثه · چالش بعدی: Checklist Progress
بیشتر بخوان: تابع در پایتون: آموزش def، پارامتر و return با مثال