Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+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 (1 point)

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 (1 point)