South Plantation High School logo
South Plantation High School · Procedural Programming with Python

while Loops & pass Practice

while · start, condition, update · accumulators · input loops · pass · 20 items · submit as a PDF

Instructions

The information on this page is not stored. If you start an assignment, you must finish it. To get a grade, you must save your results as a PDF and turn it in (steps are below).

Quick review

Counting loop: start, condition, update
count = 1              # 1. start
while count <= 5:      # 2. condition
    print(count)
    count += 1         # 3. update
Accumulator: a running total
total = 0              # start at 0
num = 1
while num <= 4:
    total += num       # add to the total
    num += 1
print(total)           # 10
Keep asking until it is right
guess = input("Password: ")
while guess != "python":
    print("Try again.")
    guess = input("Password: ")
print("Welcome!")

Messages you may see in the terminal

How this works

  1. Enter your first name, last name initial, and class period, then click Start Assignment. Your start time is recorded.
  2. The assignment opens in a Python editor with four files (tabs). Each file holds several small programs. Each orange numbered box or drop down is one item. There are 20 items.
  3. Click ▶ Run to run every program in that file. Programs that use input() get their answers typed for you (the comment says what the user types). Run does not grade you, so compare with the expected output.
  4. When you finish all four tabs, click Submit for Score. Your end time is recorded and your score appears. Answers cannot be changed after submitting.

Turning it in: save a PDF (required for a grade)

  1. After you click Submit for Score, click the Save as PDF button at the bottom of your results.
  2. In the print window, set Destination to Save as PDF (not a printer), then click Save.
  3. Keep the file name it suggests. It already has your name and period, for example While_Loops_Maria_R_P3.pdf.
  4. Turn in the PDF where your teacher tells you to.

Do not refresh or close the page until your PDF is saved. Nothing is stored, so if you leave first you will have to do the assignment again. The PDF shows your name, period, times, score, every answer, and your completed code.

PartTaskItemsPoints
1Counting loops: start, condition, update, and counting down1 to 55
2Accumulators and loops with input()6 to 105
3Debug: infinite loops, off-by-one, a loop that never runs, and pass11 to 155
4Predict what each loop does16 to 205
Total (1 point per item)2020

Student Information

Reminder: nothing on this page is saved. Once you click Start Assignment, plan to finish before you leave or refresh the page.