Built-in functions instead of a module that does not exist
Code review · Medium · §12.6 [Pair coding with AI] Asking for library suggestions
You asked an AI for code that finds the average and the maximum number of likes. When you run it, it stops with an error on the first line. You look it up and find that likestats is not in the standard library, and you never installed anything by that name. Remove the import of the module that does not exist, and fix the code so that it prints the two lines it was meant to print, using sum(), len(), and max(). Grading also runs the code with other lists in likes.
Code to fix
import likestats
likes = [12, 40, 7, 26]
print("Average:", likestats.average(likes))
print("Max:", likestats.top(likes))Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.