.count gives back 0

Hi All,

I made this tutorial and i finally (almost) manage to make one work without any ‘cheating’. The tutorial/coding made me understand a lot and gave me a boost to keep on struggling haha.

So here’s my question:
In the below code i did not use a return statement in grading_total() function. The code seems to work fine but i get a NONE when i run the code. When i tried to add “return total” it gives the average outcome of the marks used in the first function (and that makes sense ofcourse).


When you don’t have a return, yet you do print(someFunc()) (which is essentially what you’re doing, except you assign the value to a variable first), the default return value is None: since you haven’t got a return, the function can’t return anything. But you can’t just print nothing, so it prints None.
I hope this helps!