array
` module. Here is an example program to create an array :import array
# create an array of integers
int_arr = array.array('i', [1, 2, 3, 4, 5])
# create an array of floats
float_arr = array.array('f', [1.1, 2.2, 3.3, 4.4, 5.5])
# create an array of characters
char_arr = array.array('u', ['a', 'b', 'c', 'd', 'e'])
# print the arrays
print(int_arr)
print(float_arr)
print(char_arr)
array('i', [1, 2, 3, 4, 5])
array('f', [1.100000023841858, 2.200000047683716, 3.299999952316284, 4.400000095367432, 5.5])
array('u', 'abcde')
array
` module. Then we create three different arrays of integers, floats, and characters using the `array
` function. i
' for integers, 'f
' for floats, and 'u
' for Unicode characters. The second argument is a list of values to initialize the array.print
` function. Note that the output of the character array is displayed as a string, with the letter 'u
' before the string to indicate that it is a Unicode string.