{"assignment":{"_schema_version":2,"course_id":37,"date_created":"2022-06-28T19:00:00+00:00","date_modified":"2023-05-31T16:13:42.827173+00:00","extra_instructor_files":"","extra_starting_files":"","forked_id":null,"forked_version":null,"hidden":false,"id":1088,"instructions":"{\n  \"settings\": {\n    \"readingId\": \"bakery_sequences_indexes_read\"\n  },\n  \"questions\": {\n    \"Best Way to Iterate\": {\n      \"type\": \"multiple_choice_question\",\n      \"points\": 1,\n      \"body\": \"Which of the following is the easiest way to print each element of a list in Python?\",\n      \"answers\": [\n        \"<pre>for i in range(len(a_list)):\\n  print(a_list[i])</pre>\",\n        \"<pre>for element in a_list:\\n  print(element)</pre>\",\n        \"<pre>i = 0\\nfor element in a_list:\\n  print(a_list[i])\\n  i += 1</pre>\"\n      ]\n    },\n    \"Reasons for Avoiding Indexes\": {\n      \"type\": \"multiple_answers_question\",\n      \"points\": 1,\n      \"body\": \"Which of the following are reasons to avoid using indexes to process a list?\",\n      \"answers\": [\n        \"Index iteration requires extra operations and function calls\",\n        \"Index iteration is a more complex form of iteration to reason about\",\n        \"Index iteration can sometimes skip values in a list.\",\n        \"Index iteration requires a second loop.\"\n      ]\n    },\n    \"Always Avoid Indexing\": {\n      \"type\": \"true_false_question\",\n      \"points\": 1,\n      \"body\": \"You should ALWAYS avoid using index iteration to process a list. There are no advantages to it.\"\n    },\n    \"Enumerate Indexes\": {\n      \"type\": \"short_answer_question\",\n      \"points\": 1,\n      \"body\": \"The `enumerate` function consumes a list and returns each element paired with its index. When the following code is run, what is printed on the first line?\\n```python\\nvalues=[1,2,3]\\nfor i, value in enumerate(values):\\n    print(i, value)\\n```\\n\\nIf you are not sure, consider trying the code out - you don't have to guess!\"\n    },\n    \"Predict Range Function\": {\n      \"type\": \"short_answer_question\",\n      \"points\": 1,\n      \"body\": \"The `range` function consumes an integer and can be used to produce a list of numbers from 0 to that integer. When the following code is run, what is printed on the LAST line?\\n```python\\nfor value in range(10):\\n    print(value)\\n```\\n\\nIf you are not sure, consider trying the code out - you don't have to guess!\"\n    },\n    \"Predict Range Len Function\": {\n      \"type\": \"short_answer_question\",\n      \"points\": 1,\n      \"body\": \"The `range` and `len` functions can be combined to iterate through indices. When the following code is run, what is printed FIRST? Pay close attention to the code inside the `for` loop!\\n```python\\nvalues=[6, 7, 8]\\nfor index in range(len(values)):\\n    print(values[index-1])\\n```\\n\\nIf you are not sure, consider trying the code out - you don't have to guess!\"\n    },\n    \"Predict Multiple Updates\": {\n      \"type\": \"fill_in_multiple_blanks_question\",\n      \"points\": 3,\n      \"body\": \"The following code is executed:\\n\\n```python\\ndata = [[4, 6, 8]]\\n\\nfor index, value in enumerate(data):\\n    data[[index]] = data[[index]] + 1\\n    value = value * 2\\n\\ndata[[1]] = 8\\n```\\n\\nRun the code and evaluate each expression:\\n\\n1. `data[[0]]`: [index1]\\n2. `data[[1]]`: [index2]\\n3. `value`: [value]\"\n    },\n    \"Swap Variables\": {\n      \"type\": \"multiple_choice_question\",\n      \"points\": 1,\n      \"body\": \"When this code is executed, what will be printed?\\n```python\\ndata = [4, 6, 8]\\ndata[2], data[0] = [data[0], data[2]]\\nprint(data)\\n```\",\n      \"answers\": [\n        \"Nothing, because there is an error.\",\n        \"[4, 6, 8]\",\n        \"[4, 8, 6]\",\n        \"[6, 4, 8]\",\n        \"[6, 8, 4]\",\n        \"[8, 4, 6]\",\n        \"[8, 6, 4]\"\n      ]\n    }\n  }\n}","ip_ranges":"","name":"7A1) Lists and Indexes","on_change":"","on_eval":"","on_run":"","owner_id":1,"owner_id__email":"acbart@udel.edu","points":1,"public":true,"reviewed":false,"sample_submissions":[],"settings":"","starting_code":"","subordinate":false,"tags":[],"type":"quiz","url":"bakery_sequences_indexes_quiz","version":3},"ip":"216.73.216.157","submission":{"_schema_version":3,"assignment_id":1088,"assignment_version":3,"attempts":0,"code":"","correct":false,"course_id":37,"date_created":"2026-05-20T12:41:57.834140+00:00","date_due":"","date_graded":"","date_locked":"","date_modified":"2026-05-20T12:41:57.834140+00:00","date_started":"","date_submitted":"","endpoint":"","extra_files":"","feedback":"","grading_status":"NotReady","id":2036753,"score":0.0,"submission_status":"Started","time_limit":"","url":"submission_url-5c377042-1cd5-4e8e-b140-4878e8be726c","user_id":2044660,"user_id__email":"","version":0},"success":true}
