IDNLearn.com: Your destination for reliable and timely answers to any question. Discover comprehensive answers from knowledgeable members of our community, covering a wide range of topics to meet all your informational needs.
28. Which method or operator can be used to concatenate lists? A. B. + C. % D. concat 29. What will be the value of the variable list after the following code executes? list = (1, 2, 3, 4] list[3] = 10 A. [1, 2, 3, 10] B. [1, 2, 10, 4] C. [1, 10, 10, 10] D. Nothing; this code is invalid 30. Consider the following list: inventory = ["washer", "dryer", "microwave") Which of the following will display the item value, "dryer"? A. print(inventory[0]) B. print(inventory(1) C. print(inventory[2]) D. printinventory(-1)) 31. What will be the value of the variable list2 after the following code executes? list1 = [1, 2, 3] list2 = 0 for element in list1: list2.append(element) list1 = [4, 5, 6] A. [4, 5, 6] C. (1,2,3,4,5,6] B. (1, 2, 3] D. None of the above 32. Given that: aList = [1,2,3,4] which of the following will display the list [2,3,4] at the screen? A. print(aList[1:3]) B. print(aList[2:41) C. print(aList[2:1) D. print(aList[-3:]) 33. Given that: aList = [1,2,10,11,12,13] del aList[3] what will be printed by print (aList) A. [1,2,11,12,13] C. [1,2,10,12,13] B. (1,10,11,12,13] D. (1,2,10,11,13] 34. Given that: my_tools = ['hammer', 'screwdriver', 'wrench', 'pliers', 'nailer', 'table saw') my_tools[2:4]= ['chainsaw', 'chipper'] what will be printed by print (my_tools) A. ['hammer','chainsaw', 'chipper','screwdriver','wrench','pliers', 'nailer', 'table saw'] B. ['hammer','screwdriver', 'wrench', 'chainsaw', 'chipper', 'nailer', 'table saw') C. ['hammer','screwdriver', 'chainsaw','chipper', 'nailer', 'table saw'] D. ['hammer',chainsaw', 'chipper','pliers', 'nailer', 'table saw') 35. Given the following list: Names = ['Dan', 'Mary', 'Bill', 'Juanita', 'Harry', 'Sarah'] Which of the following will change the list names to ['Dan', 'Mary', Juanita', 'Harry', 'Sarah') ? A. del Names[3] B. erase('Bill') C. Names.pop('Bill') D. Names.pop(-4) E. Names.insert(2, nothing)
Sagot :
Your engagement is important to us. Keep sharing your knowledge and experiences. Let's create a learning environment that is both enjoyable and beneficial. IDNLearn.com is committed to your satisfaction. Thank you for visiting, and see you next time for more helpful answers.