Error Lab
Every diagnostic below is the real output of ptc, not a mock-up. Pick a mistake, read how the compiler teaches the canonical form, then flip to the fix.
elif, not else if
Python writes elif, C-family languages else if. POLYTONE picked one — elif — and the other spelling teaches it instead of failing on the if.
let n = 7
if n > 10:
print("big")
else if n > 5:
print("medium")
else:
print("small")The compiler answers
error: there is no 'else if' — write 'elif condition:' (line 4, column 6)let n = 7
if n > 10:
print("big")
elif n > 5:
print("medium")
else:
print("small")Fixed — and it runs
medium