{"id":"code-hs-python-error-flashcards","audience":"high-school","category":"coding","track":"coding","technique":"grounding","title":"Turn your notes on Python errors into printable flashcards","free":false,"task":"Your Intro to Python test will ask you to name error types. Make exactly 6 numbered lines in the form 'ErrorName: cause', each cause under 10 words, including the 3 errors your teacher starred and using her correction about IndentationError. Use only your notes, and no code blocks or code examples, under 90 words.","materialLabel":"Your class notes (attached to your prompt automatically)","material":"Intro to Python - Errors and debugging (Ms. Achebe), Tuesday\n\nSyntaxError - Python can't read the line at all (missing colon,\n  unclosed quote or bracket)\n* NameError - you used a name Python doesn't know (typo, or used it\n  before you made it) *\n* TypeError - wrong type for the operation, like \"5\" + 3 *\nValueError - right type but bad value, like int(\"abc\")\n* IndexError - list index too big (or too small), like nums[10] on a\n  list of 3 *\nKeyError - dictionary key that isn't there\nZeroDivisionError - dividing by zero\n~~IndentationError - only happens with tabs~~\n  <- Ms. Achebe corrected this Weds: it happens when the indenting is\n     wrong or inconsistent, tabs OR spaces!\nAttributeError - the thing doesn't have that method, like 5.upper()\n\n(* = \"these 3 will definitely be on the test\" ... wait she said 3 but\n I starred 4? NameError, TypeError, IndexError are the ones she\n said. I starred ValueError by mistake.)\n\nRemember: read the LAST line of the error first!","rules":[{"type":"numberedItems","count":6},{"type":"codeBlocks","count":0},{"type":"maxProseWords","max":90}],"mistakes":[{"title":"Missing the test errors","why":"The notes have a mis-starred line; the AI may pick ValueError instead of one the teacher named.","fix":"Add: \"Must include NameError, TypeError and IndexError.\"","checks":["r0"]},{"title":"Front/back blocks with code","why":"The AI likes card layouts with code examples, which don't print as quick cards.","fix":"Show it: \"One line each, like 'KeyError: dictionary key that isn't there'. No code.\"","checks":["r1","codeBlocks"]},{"title":"Copying the crossed-out fact","why":"The old IndentationError line is still in the notes.","fix":"Add: \"Use the teacher's correction for IndentationError.\"","checks":["r2"]},{"title":"Too many cards","why":"The AI turns every line into a card plus extras.","fix":"Add: \"Exactly 6 numbered lines, each cause under 10 words.\"","checks":["numberedItems","maxProseWords"]}],"promptHints":[{"label":"Sets the number of cards","patterns":["\\b(6|six)\\b.{0,20}(card|line)"]},{"label":"Shows the card shape","patterns":["errorname: cause","one line","like ['\"]"]},{"label":"Names the starred errors","patterns":["nameerror","typeerror","indexerror","star"]},{"label":"Mentions the correction","patterns":["correct","indentation"]},{"label":"Says to use only the notes","patterns":["only.{0,20}notes","no code"]}],"hint":"Flashcards work when they're short, match the test and use the corrected facts. Tell the AI how many, the shape, which errors must be there and to follow your teacher's correction.","rubricLabels":["Includes NameError, TypeError and IndexError (the three the teacher named), each as its own line","Every line is in the form 'ErrorName: cause' on a single line, with no code examples","If IndentationError appears, its cause says wrong or inconsistent indenting (tabs or spaces), not 'only tabs'; and no error types or facts appear that aren't in the notes"]}