75.1k views
23 votes
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?

1 Answer

5 votes

Answer:

K.append(12)

Step-by-step explanation:

From the question, the array name is K.

In python, to add to an array, you make use of the following syntax.

[array-name].append(value)

In this case:

[array-name] = k

and the value to be added is:

value = 12

So, we have:

K.append(12)

User Akobold
by
4.8k points