Reference Engine

Solutions Mastery

The centralized logic bank. Review and audit production-ready Python code for all 20 modules.

Phase 01: The Basics

Card 1: Tech Event
print("Event: Tech Conf")
print("Date: Dec 12")
print("Status: Active")
Card 2: Game Time
total = 135
hrs = total // 60
mins = total % 60
print(str(hrs) + "h " + str(mins) + "m")
Card 3: Security Gen
first = input("First: ")
last = input("Last: ")
print("ID: " + first + last)

Phase 02: Decisions

Card 4: Age Check
age = int(input("Age: "))
is_adult = age >= 18
print("Can Enter: " + str(is_adult))
Card 5: Triangles
if side1 == side2 or side1 == side3:
    print("Isosceles")
else:
    print("Scalene")
Card 6: Complex Alarm
if sensor > 50 and not auto:
    print("ALARM")
elif sensor > 20:
    print("Monitor")
else:
    print("Idle")

Phase 03: Iteration

Card 7: Ticket Count
tickets = 0
while tickets < 5:
    input("Click to sell...")
    tickets = tickets + 1
print("Sold Out")
Card 9: Grid Matrix
scores = [10, 20, 30]
scores[0] = 15
print(scores[0] + scores[2])
Card 11: Linear Seek
found = False
for x in data:
    if x == "Target":
        found = True
print(found)

Phase 04: Structures

Card 14: String Slice
# 3 chars first, 3 chars last, year
pw = first[0:3] + last[0:3] + year
print(pw)
Card 15: File I/O
f = open("scores.txt", "a")
f.write(name + "," + score + "\n")
f.close()
Card 17: 2D Grid
for row in grid:
    for item in row:
        print(item)

Phase 05: Algorithms

Card 16: Sort Swap
if nums[i] > nums[i+1]:
    t = nums[i]
    nums[i] = nums[i+1]
    nums[i+1] = t
Card 18: Range Gate
score = int(input("Score: "))
while score < 0 or score > 100:
    print("Invalid")
    score = int(input("Try again: "))
Card 19: SQL Order
SELECT name, score 
FROM users_data 
WHERE score > 100 
ORDER BY score DESC

Phase 06: Exam Readiness

Diagnostic Suite

Use these finalized patterns to audit your own code during exam practice sessions.

Back Python: SQL
Curriculum Exit Return to Hub