208k views
3 votes
Choose the typecode for the array. arr = array.array([5.3, 1.8, 2.35])
a) I
b) B
c) F

User Reza GH
by
7.9k points

1 Answer

4 votes

Final answer:

The correct typecode for the array containing floating point numbers is 'F', which represents a double type floating point array in Python.

Step-by-step explanation:

The typecode for the array arr = array.array([5.3, 1.8, 2.35]) should correspond to the data type of the elements within the array. Since the elements are floating point numbers, the appropriate typecode would be 'c'. The typecodes 'I' and 'B' represent unsigned integer and unsigned char types, respectively, which are not suitable for floating point numbers. Therefore, the correct answer is 'c' for a double type floating point array in Python.

User CalculatingKraken
by
7.6k points