At GAA training, how many teams of five can you make from 23 players?
Twenty-three players turn up for a GAA training session, and you need teams of five. How many full teams can you make, and how many players will be left over? A single division result doesn't show both counts directly.
You already know how to read inputs and display results. In your pseudocode, read the player count and team size first. Then calculate two counts: complete teams and leftover players. Output both counts in that order.
Keep the inputs at twenty-three and five. Plus adds them to give twenty-eight. Minus takes five away to give eighteen. The star multiplies them to give one hundred and fifteen. A single slash divides them and gives four point six.
Suppose you change the number of players to seventeen but keep the team size at five. What result does Python give for seventeen single slash five? Pick the result of that expression.
Trace eighteen minus two times three squared plus five. In Python, the double star means raise to a power. Three squared is nine. Next, two times nine is eighteen. Subtraction and addition share a level, so go left to right: eighteen minus eighteen gives zero, then add five.
Four teams use twenty players. Five teams would need twenty-five, and you've only got twenty-three. Double slash, called floor division, gives the whole-number quotient, four. The percent sign gives the remainder, three. You can check by putting the twenty team players and the three leftovers back together.
Now you've got twenty-nine players and want teams of six. Work out how many complete teams you can make, then count who's left. Pick the option that gives those two counts in that order.
Double slash counts the full groups. The percent sign counts individual players left outside those groups. If you swap the results, three teams of five plus four leftovers accounts for only nineteen players. Four teams of five plus three leftovers accounts for all twenty-three.
Give your function two integer inputs: a player count of zero or more, and a team size of at least one. Use double slash to calculate the full teams, then the percent sign to calculate the leftovers. Return the team count first and the leftovers second.