QUESTION IMAGE
Question
multiple choice
the type code for an int array is b. what line of code creates an array of int data values?
○ intarray = array(b,2, 5, 10)
○ intarray.array(b,2, 5, 10)
○ intarray = array(b,2, 5, 10)
○ intarray.array(b,2, 5, 10)
In Python's array module, to create an array of integer data values with type - code 'b', we use the array function and pass the type - code as the first argument and a sequence (list in this case) of values as the second argument. The correct syntax for creating an array object and assigning it to a variable is intArray = array('b', [2, 5, 10]).
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
C. intArray = array('b',[2, 5, 10])