Mean variance calculator

Tell us what’s happening:
Describe your issue in detail here.
I fail 2 tests with the error message:

. File “/home/runner/boilerplate-mean-variance-standard-deviation-calculator/”, line 15, in test_calculate2
self.assertAlmostEqual(actual, expected, “Expected different output when calling ‘calculate()’ with ‘[9,1,5,3,3,3,2,9,0]’”)
File “/usr/lib/python3.8/unittest/”, line 943, in assertAlmostEqual
diff = abs(first - second)
TypeError: unsupported operand type(s) for -: ‘dict’ and ‘dict’

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

Challenge: Mean-Variance-Standard Deviation Calculator

Link to the challenge:

This error here means basically that result returned by function is different than what is expected.

assertAlmostEqual method used in the tests is able to determine, when two dictionaries are equal, but it cannot determine if they are almost equal up to some specific precision.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.