QUESTION IMAGE
Question
you have this code in your program. from array import * k = array(b,10, 5, 2, 7) which line of code will add 12 to the array? k.append(12) k.search(12) k.index(12) k.add(12)
In Python's array module, the append method is used to add an element to the end of an array. The search method is not a standard method for arrays in Python's array module for adding elements; it is often used for finding elements in other contexts. The index method is used to find the index of a given element in the array, not for adding. And there is no add method for arrays in the array module in Python.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
A. K.append(12)