PCEP case studies
PCEP · Put your knowledge to work in context.
PCEP™ – Certified Entry-Level Python Programmer (exam code PCEP-30-03) is the entry-level credential in the Python Institute's General-Purpose Programming certification pathway, which continues with PCAP™, PCPP1™ and PCPP2™. It is intended for students, beginners, career changers and working professionals who want independent evidence that they can read, trace, complete and write short Python programs. The PCEP case studies are 5 cases and about 3,208 words.
1Scoreboard Arithmetic in a Step-Challenge Script
Priya is writing a warm-up script for a school step challenge. Step counts arrive from a web form, so she keeps them as text and then applies a bonus multiplier.
642 words, about 3 min2Crate-Code Loop That Never Reports Completion
Marcus maintains the batch-code printer for a packing line. Crates are numbered 1 to 12.
611 words, about 3 min3Inventory Lists, a Tuple, and a Set That Will Not Index
An inventory script starts with shelf a = ["bolt", "nut"] , then shelf b = shelf a and shelf c = shelf a[:] . A helper appends "washer" to shelf b and removes "bolt" from shelf c .
673 words, about 3 min4Temperature Converter with a Sticky Default List
A lab technician writes a converter for a logging tool: def to celsius(f, history=[]): result = (f - 32) 5 / 9 history.append(f) return result def safe convert(text): try: value = int(text) print(to celsius(value)) except ValueError: print("not a number") The tool calls safe convert("50") , safe convert("50.5") , and safe convert("abc") . The first prints 10.0 .
650 words, about 3 min5Audit Log That Reports One Line and Zero Errors
During an incident review, a junior admin shows this log tool: log = open("audit.txt", "w") log.write("ERROR disk full") log.write("INFO retry") count = log.write("WARN slow") print(count) log.close() with open("audit.txt") as f: lines = f.readlines() errors = 0 for line in lines: if line == "ERROR": errors += 1 print(len(lines), errors) The tool prints 9 and then 1 0 , but the admin expected three lines and one error. Worse, after the tool runs a second time the previous day's entries are gone.
632 words, about 3 min