Mini-Quiz 3, then build and ship your chain
End of Module 3. A 15-minute quiz to lock in blockchain concepts — then the most ambitious lab yet: your own complete blockchain in one file.
No computers. Covers the blockchain concepts and Python code from Days 21–29.
chain[2]["data"] = "tampered!"
# Question: After this line,
# what does is_valid_chain(chain) return
# and WHY?One Python file. All the functions. Working end to end.
# When run, your file should:
chain = [make_block(0, [], "0" * 64)] # genesis
add_block(chain, [{"from":"Alice","to":"Bob","amount":10}])
add_block(chain, [{"from":"Bob","to":"Carol","amount":4}])
add_block(chain, [{"from":"Alice","to":"Dave","amount":2}])
for b in chain:
print(f"Block {b['index']:2d} | nonce={b['nonce']:6d} "
f"| hash={b['hash'][:16]}...")
result, msg = is_valid_chain(chain)
print(f"\nChain valid: {result} — {msg}")