InterCourses
CoursesBlogs
0
All courses/Python BasicsProject: Workshop sign-in
Decisions and Loops
9 / 10
← Python Basics
○Welcome to Python○Demo: Print a Message○Exercise: Print an Announcement○Demo: Names and Values○Exercise: Label a Station○Demo: Inspect Data Types○Exercise: Record Supplies✦Module Quiz
○Demo: Calculate with Numbers○Exercise: Calculate a Bus Cost○Demo: Format a Message○Exercise: Format an Invoice○Demo: Convert Text to Numbers○Exercise: Convert Measurements○Demo: A Prefilled User Response○Exercise: Build a Workshop Ticket✦Module Quiz
○Compare and branch○Exercise: Choose a shelf sign○Repeat with while○Exercise: Charge a device○Count with for and range○Exercise: Mark bus stops○Skip with continue, stop with break○Exercise: Admit visitors●Project: Workshop sign-in✦Module Quiz
○Define and Call: Demo○Exercise: Define and Call○Parameters and Return: Demo○Exercise: Parameters and Return○Defaults and Keywords: Demo○Exercise: Defaults and Keywords○Local Scope: Demo○Exercise: Local Scope○Project: Workshop Receipts✦Module Quiz
○Index a Text Code○Exercise: Read Badge Edges○Slice a Route Label○Exercise: Slice Ticket Fields○Clean a Message with Methods○Exercise: Standardize a Notice○Format a Card with an f-String○Exercise: Make a Market Sign✦Module Quiz
○Create and Index a Supply List○Exercise: Build a Queue○Change a Playlist○Exercise: Update Orders○Loop and Slice a Route○Exercise: Pack Deliveries○Read a Fixed Tuple Record○Exercise: Read a Session Record✦Module Quiz
○Look Up and Update a Dictionary○Exercise: Update a Contact○Loop Through Dictionary Entries○Exercise: Write a Receipt○Keep Unique Visitors in a Set○Exercise: Compare Club Groups○Demo: Summarize Library Visits○Exercise: Build a Market Roster✦Module Quiz
○Tracebacks and a Safe Count Demo○Exercise: Recover Ticket Counts○Write and Read a Browser File Demo○Exercise: Save and Read a Message○Mini Project: Attendance Log✦Module Quiz
○Import Math: Demo○Exercise: Import Math○Local Module: Demo○Exercise: Local Module○Packages and Dotted Imports✦Module Quiz
○Recursion and a Base Case Demo○Exercise: Recursive Ticket Sum○Lambda, Map, and Filter Demo○Exercise: Clean Badge Names✦Module Quiz
○Classes, Objects, and Enums to Recognize○Final Project: Workshop Board✦Module Quiz

Project: Workshop sign-in

A community workshop has two seats. Ticket 2 is illegible, so issue passes to other ticket numbers in order until capacity is reached. The starter provides the limit, blank records, and print statements. This combines a comparison with if, for over range, continue to skip the unusable ticket, and break to end admission. Finish with a status selected by if / else. No terminal input() is needed: the fixed ticket numbers make Run repeatable in the browser.

Edit main.py, press Run to see Passes: 1 3 , Issued: 2, and Status: Full on separate lines; press Submit to check each task.

Your Task

  1. Loop over ticket numbers 1 through 6. Skip ticket 2 with continue; issue every other number by appending f"{ticket} " to passes and increasing issued. At this stage, the string starts 1 3 and has no ticket 2.
  2. After counting each admission, use break when issued == capacity. Now the supplied output shows Passes: 1 3 and Issued: 2.
  3. After the loop, use if / else to set status to "Full" when issued == capacity, or "Open" otherwise. The supplied output shows Status: Full; if capacity is 8, all five valid tickets are issued and status is Open.

The sign-in desk is ready: you can now decide, repeat, skip, and stop within one small program.

Take the Quiz →
Loading editor…
Press Run to execute your code.