In: Computer Science
Array, a most used data structure, when similar data items are needs to be handled in a program.In case of scientific calculation, using array gives edge to solve the problem quickly and in a easy way. For example, matrix and its manipulation uses array to store data and these data using scientific calculator such as transposing matrix or adding new matrix or performing any operation over these data can be easily implied with iterating the elements of array. Arrays are essential for implementing many data sets operation to calculate trignometric functions or to calculate the power and storing to keep track of it.
Below is the calculation to change array of integer to change them to farenheit and storing these results generated in another array for further use -(celsius is the array which cotains integers, and operation is performed to convert each value to equivalent farenheit and store the generated data.)
celsius = [20.1, 20.8, 21.8, 21.2, 20.9, 20.1, 22.7, 22.3]
x=[]
i=0
for i in range(0,8):
x.append(celsius[i] * 9 / 5 + 32)
print(x)