Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+9 votes

Why does my program print none after it gives the output desired for both options 4 and 5?

asked in old_CSC201 by (8 points)

1 Answer

+1 vote

Did you put the call to my printTopN function in a print statement? You shouldn't. printTopN does not have a return statement and so returns None. If you have the call in a print statement, then it prints the returned value which is None.

answered by (8 points)
...