Answer:
- import math
-
- def standard_deviation(aList):
- sum = 0
- for x in aList:
- sum += x
-
- mean = sum / float(len(aList))
-
- sumDe = 0
-
- for x in aList:
- sumDe += (x - mean) * (x - mean)
-
- variance = sumDe / float(len(aList))
- SD = math.sqrt(variance)
-
- return SD
-
- print(standard_deviation([3,6, 7, 9, 12, 17]))
Explanation:
The solution code is written in Python 3.
Firstly, we need to import math module (Line 1).
Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).
We can test the function using a sample list (Line 20) and we shall get 4.509249752822894
If we pass an empty list, a ZeroDivisionError exception will be raised.
Answer:
scanf("%d %lf %c", &age, &pay, §ion);
Explanation:
To read the value in c program, the instruction scanf is used.
To read the integer value, use the %d format specifier in the scanf and corresponding variable name age with ampersand operator.
To read the double value, use the %lf format specifier in the scanf and corresponding variable name pay with ampersand operator.
To read the character value, use the %c format specifier in the scanf and corresponding variable name section with ampersand operator.
Answer:
The answer is Frequency Spectrum.
Explanation:
The frequency spectrum is range of all component frequencies.It contains all the waves which are as following:-
Gamma Rays
X-Rays
Ultraviolet
Visible light.
Infrared
Micro wave
Radio wave
These all waves have their range of frequencies.The waves that are visible to us is only the visible light.