Checking code that averages star ratings
Predict the output · Medium · §5.4, §5.7 [Pair coding with AI] Asking for calculations
You check AI-written code for an average star rating with the three checks from §5.7 (the division sign, float comparisons, and boundary inputs). Predict the result without running the code.
Code
stars = 13
count = 3
print(stars // count)
print(round(stars / count, 2) == 4.33)
count = 0
print(stars / count)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.