9. Write a python program to add in another set of array_a into the initial array_a as provided in the following output.
The output is:
array_a = array('b', [0, 1, 2, 3, 4, 5])
Expected Answer:
The initial array: array('b', [0, 1, 2, 3, 4, 5])
The new array: array('b', [0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5])
Sample Answer:
from array import * array_a = array('b', [0, 1, 2, 3, 4, 5]) print("The initial array: "+str(array_a)) array_a.extend(array_a) print("The new array: "+str(array_a))
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)