Problem 142499 · easy · Phase 01 Prerequisites & Setup

Sharing Pizza Slices

functions · integer division · modulo · tuples

Some pizzas are being shared equally among a group of people. Write share_pizza(pizzas, slices_each, people) that returns a tuple (per_person, leftover): how many whole slices each person gets and how many slices are left over.

Examples

Input:  pizzas = 3, slices_each = 8, people = 5
Output: (4, 4)

Constraints

  • 0 <= pizzas <= 1000, 1 <= slices_each <= 16, 1 <= people <= 1000

Goals

  • Compute a total from two counts
  • Use // and % together to share things fairly
Starting Python…