03.14 · Python basics / Practice · 6 min
Allocate whole tickets to each team
Eleven tickets must be shared equally among four teams. A team cannot receive a fraction of a ticket.
Activity 14 of 19 in Python basics
Python Basics / 03.14
Practice numbers
Not started
Use floor division for a whole-ticket allocation and remainder for the tickets left over.
Your lesson progress
Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.

Build it one step at a time
Prefer learning by typing? Work through short instructions, run the Python code and check each change before continuing. Your guided project saves separately from the challenge below.
The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.
Start mini-lesson(opens in a new tab)6 steps · Saved work · Instant feedback
YOUR TURN
Give each team whole tickets
Keep tickets assigned to 11 and teams assigned to 4. Change per_team to calculate how many whole tickets each team receives using floor division. Keep leftover calculated with the remainder operator and keep both print calls. To pass: tickets must stay 11, teams must stay 4, per_team must hold 2, leftover must hold 3, and the program must print 2 then 3, once each. After passing, change the starting counts and predict the new result before running again.
2 3
Keep the starting inputs. Print these lines in this order, without extra output.
- tickets still holds 11
- teams still holds 4
- per_team holds 2 whole tickets
- leftover holds 3 tickets
Edit Python, then run it. Check challenge checks your output and the listed Python requirements. Your code saves on this browser after a short pause. Sign in and choose Save account draft to keep it across devices. Word wrap is enabled.
Ready to checkRun the checks to see your results here.
Your check results
Need a nudge?
A fraction is the wrong answer to this question
The / operator returns a fractional quotient. Compare it with the operator that counts complete groups for these positive integers.
Check that every ticket is accounted for
Four teams receiving two tickets use eight tickets. The remainder is the three tickets still unallocated. Keep that calculation separate from per_team.
One possible solution
Your code may look different and still be correct. Compare the approach with your own.
For these positive integer inputs, tickets // teams gives 2 whole tickets per team and tickets % teams gives 3 left over. The check 2 * 4 + 3 = 11 accounts for every ticket. The tests verify output and stored values, not a particular source spelling; vary the inputs to check that your expressions calculate the results rather than hardcode them.
tickets = 11
teams = 4
per_team = tickets // teams
leftover = tickets % teams
print(per_team)
print(leftover)Ready to try it?
Practice in your browser and see your results.
Progress details
Have a question?
Ask the Code Zone community.
Ask a question in The Code Zone (opens in a new tab)Continue learning

7 days freeTry The Code Zone
THE CODE ZONE COMMUNITY
Your next step is easier together.
Try the community free for 7 days.
No charge during your trial. Choose your plan on Skool.
- Ask questions and get support in the community
- Watch every course video walkthrough
- Find a study buddy in the 24/7 study room
Make the most of your trial with Premium.
Choose Premium on Skool to try Thursday live help sessions. Bring your questions, work through code, and get unstuck together.
Scheduled Thursdays in Eastern Time. Check the Skool calendar for your local date and time.
Have a website account? Sign in