[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-461668-105":59,"doc-detail-461668-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","quiz-02-practice-comp-110-practice-quiz-spring-2024","Quiz 02-Practice - COMP 110 Practice Quiz - Spring 2024","","Programming fundamentals practice quiz for COMP 110 in Spring 2024, dated Thursday March 7, 2024. Covers multiple-choice concepts like variable binding and initialization, evaluation order, truth of equivalences and increment operations, mutability of tuples and lists, list indexing errors, and identifying “use cases” for functions. Includes short-answer coding tasks on list operations, index assignment and swapping values, nested list access, and memory-diagram tracing for a mutator function and list-combining and insertion-sort implementations.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":20,"@type":76,"position":81},"https://docshare.wps.com/document/exam/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/quiz-02-practice-comp-110-practice-quiz-spring-2024/461668/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/quiz-02-practice-comp-110-practice-quiz-spring-2024/461668.png","ImageObject",300,407,{"name":92,"@type":93},"OmBimo","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-10-25","2026-09-30",true,{"@type":102,"interactionType":103,"userInteractionCount":24},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What does Question 1 cover in this practice quiz?","Question",{"text":112,"@type":113},"Question 1 is a multiple-choice section testing understanding of variables, initialization, evaluation order, increment statements, mutability, list index errors, and while-loop termination behavior.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What programming tasks are included in Question 2?",{"text":117,"@type":113},"Question 2 asks for expressions and statements involving list indexing, appending elements, computing length, updating list elements, swapping values using a temporary variable, accessing nested list values, and popping items by index.",{"name":119,"@type":110,"acceptedAnswer":120},"What are Questions 3–5 focused on?",{"text":121,"@type":113},"Questions 3–5 focus on tracing memory diagrams for provided Python-like code, including a mutator function with globals and heap/list effects, a combine function adding list elements item-wise, and an insertion sort implementation.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},461668,1791491022,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":19,"category_name":20,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":24,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":144,"read_time":145,"preview_page_count":4},962090893581,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Quiz 02-Practice  \nCOMP 110: Introduction to Programming  \nSpring 2024  \nThursday March 7, 2024  \nName:    \n9-digit PID:    \nDo not begin until given permission.  \nHonor Code: I have neither given nor received any unauthorized aid on this quiz.  \nSigned:    \nQuestion 1: Multiple Choice Completely fill in the bubble next to your answer using a pencil. Each question should have exactly one filled-in bubble.  \n1.1. A variable’s value should not be reassigned after initialization.  \n⃝ True  \n False  \n1.2. The first time a variable is bound to a value is referred to with which of the following special names?  \n⃝ Assignment  \n Initialization  \n⃝ Relative Reassignment  \n⃝ Declaration  \n1.3. Which side of the following statement should be evaluated first?  \n⃝ x  \n y  \n1.4. The following two statements are equivalent to one another and interchangeable:  \nFalse ⃝ True  \n1.5. The following statement increments x’s value by 1.  \nFalse ⃝ True  \n1.6. The following statement increments x’s value by 1.  \n⃝ False  \n True  \n1.7. Tuples and lists can both be mutated after creation.  \n False ⃝ True  \n1.8. When accessing an index of a list that does not exist, what kind of error is encountered?  \n⃝ NameError  \n⃝ KeyError  \n IndexError  \n⃝ StackOverflowError  \n1.9. When accessing an element of a list, what kind of value most generically describes what is found inside the subscription notation’s square brackets. E.g. a_list[HERE]  \n⃝ Integer Literal  \n⃝ Data Type  \n Integer Expression  \n⃝ Integer Variable Name  \n1.10. Generally, to avoid an infinite while loop, each iteration of the loop body should change a variable involved in the while loop’s test condition bringing it closer to False:  \n⃝ False  \n True  \n1.11. Consider a function named f with a while loop. In the while loop’s body, there is a return statement. At most, how many times will this return statement be evaluated in a single function call to f?  \n 1  \n⃝ As many times as the loop iterates  \n⃝ Infinite  \n1.12. Which of the following describes a test written to demonstrate an expected usage of a function?  \n⃝ Edge Case  \n Use Case  \n1.13. What is the evaluation of the following expression:  \n⃝ 10  \n⃝ 20  \n 30 ⃝ IndexError  \nQuestion 2: Respond to the following questions Consider the following code listing:  \n1 2  \n3  \nanimals : list [ str ] = [ \" fox \" , \" bear \" , \" rabbit \" ]  \nints : list [ str ] = [1 , 1 , 1 , 1]  \ntwo_ d : list [ list [ int ]] = [[10 , 20], [30 , 40], [50 , 60]]  \n2.1. Write an expression that evaluates to \"bear\", making use of the animals variable.  \nSolution: animals[1]  \n2.2. Write a method call that adds the value \"mouse\" to the animals list.  \nSolution: animals.append(\"mouse\")  \n2.3. Write a function call expression that evaluates to the quantity of values in the animal list.  \nSolution: len(animals)  \n2.4. Write an expression that increments the 3rd value in ints to be one greater than its previous value (regardless of what the previous value was) .  \nSolution: ints[2] = ints[2] + 1 or ints[2] += 1  \n2.5. Write a sequence of 3 assignment statements that will swap the values of the 0 and 1 index in animals. You will need to declare and initialize a temporary variable.  \nSolution:  \ntemp: int = animals[1] animals[1] = animals[0]  \nanimals[0] = temp  \n2.6. Write an expression that accesses the value 40 stored in the two_d variable.  \nSolution: two_d[1][1]  \n2.7. Write an expression that accesses the list [50, 60] stored in the two_d variable.  \nSolution: two_d[2]  \n2.8. Write an expression that removes the item at index 1 from animals.  \nSolution: animals.pop(1)  \nQuestion 3: Memory Diagram Trace a memory diagram of the following code listing.  \n1 2  \n3 4  \n5 6  \n7 8  \n9  \n10  \n11  \n12  \n13  \n14  \ndef mutat or ( x : int , xs : list [ int ]) - > None :\"\"\" An impure function ... \"\"\"  \nx += 1  \nxs [0] += 1  \ny : int = x + 1  \nprint ( f \" mutat or x : { x } , xs : { xs } , y : { y } \" ) return x  \nx : int = 0  \nxs : list [ int ] = [0]  \ny : int = 0  \nprint ( f \" globa","cbCaitPHALqUur5x","https://ap.wps.com/l/cbCaitPHALqUur5x","pdf",17405078,11,"English","# Question 1\n## Multiple Choice\n# Question 2\n## Code Practice Questions\n# Question 3\n## Memory Diagram Trace\n# Question 4\n## Memory Diagram Trace\n# Question 5\n## Memory Diagram Trace\n# Question 6\n## Memory Diagram Trace","[{\"question\":\"What does Question 1 cover in this practice quiz?\",\"answer\":\"Question 1 is a multiple-choice section testing understanding of variables, initialization, evaluation order, increment statements, mutability, list index errors, and while-loop termination behavior.\"},{\"question\":\"What programming tasks are included in Question 2?\",\"answer\":\"Question 2 asks for expressions and statements involving list indexing, appending elements, computing length, updating list elements, swapping values using a temporary variable, accessing nested list values, and popping items by index.\"},{\"question\":\"What are Questions 3–5 focused on?\",\"answer\":\"Questions 3–5 focus on tracing memory diagrams for provided Python-like code, including a mutator function with globals and heap/list effects, a combine function adding list elements item-wise, and an insertion sort implementation.\"}]","Quiz 02-Practice - COMP 110 Practice Quiz - Spring 2024 | PDF",1790762100,28]