Mean-Variance-Standard Deviation Calculator: Nonetype error

Hi there!

I did the program for Mean-Variance-Standard Deviation calculation, but although i was sure it will pass with no errors, it fails for something being a ‘NoneType’. What is that difference that the test is doing? diff = abs(first- second) I understand that it’s between ‘something’ and the dictionary where the calculations are stored.

Link: https://repl.it/@ungureanudaniel/boilerplate-mean-variance-standard-deviation-calculator#test_module.py

In Python, None usually means that a function failed to return a value. I would guess that you are failing to return something when you should be, but I don’t have time to look deeply at your code right now.

1 Like

It does return the dictionary all correct, from a numbers perspective, in jupyter nb.

Something is returning a None, and it’s not the data inside of the test suite. Unless you modified the test suite, it has to be in your code.

Ohh crack, it was the ‘return calculations’ syntax in my repl, not properly aligned…just couldn’t see it. Thank you!

1 Like

Indentation in Python can be rather unforgiving

Hi ungureanudaniel, that’s the most elegant looking code that I have seen for this project that I have seen, trying to chug through it myself but i get speed bumps at every step of the way(learning process i guess). So trying to understand the process of functions etc so hardly an if/else statement to be seen, your code defines an output so you can append to it later, why are they asking to output to a dictionary rather than a list?

Cheers

Brett