Full pages and leftover posts
Code review · Medium · §5.1, §5.7 [Pair coding with AI] Asking for calculations
Each page shows per_page posts. You asked an AI for code that prints the number of full pages and the number of posts left over for the last page, and this is the code you got. It runs without errors, but it prints 4.7 0.0. Fix just one place so that it prints 4 7.
Code to fix
posts = 47
per_page = 10
full = posts / per_page
left = posts - full * per_page
print(full, left)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.