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:
(a) What is the best case time complexity of the algorithm (assuming n > 1)?
Answer: O(1)
(b) What is the worst case time complexity of the algorithm?
Answer: O(n^4)
Explanation:
(a) In the best case, the if condition will be true, the program will only run once and return so complexity of the algorithm is O(1)
.
(b) In the worst case, the program will run n^4 times so complexity of the algorithm is O(n^4).
ESC key can the requestor press to terminate the connection.
<h3>what is the ESC key?</h3>
- The European Society of Cardiology is a professional organization that strives to increase scientific knowledge of the heart and vascular system as well as the prevention, diagnosis, and treatment of disorders of the heart and blood vessels.
To learn more about ESC key, refer
to brainly.com/question/25689052
#SPJ4
A cover letter is a document sent with your resume to provide additional details about you. The cover letter is what introduces your resume and you.
<span>A few short tips for writing cover letters. i dont know if thats the answer you looking for</span>
Answer:
print("I like to code")
Explanation:
In the Programming Languages, print() function is used to print any string, display any output or both at the same time as well as we can print it one by one. We can also print addition, subtraction, multiplication and other problems directly without saving it in other objects or variables.
In the above statement, the correct method of printing any string is to write that string inside the parameter with a double-quote.
The second option is incorrect because in it double-quote is not used.
The third option is incorrect because the following sequence is not correct.