# Week III ## Debug - Tracing the flow of a program ```python def main(): total = 0 for i in range(100): new_total = total + i print(f"The sum of the first 100 numbers is {new_total}") ``` - `str(new_total)` --> ## Frontends vs Backends - Logic <--> Backends - Interaction <--> Frontends ## Decomposing Running Sum ### Interact with the user - Function to loop the program - Conditional to handle the exit ### Calculate - Handle each input - Track previous inputs > Premature optimization is never good **Yak Shaving** -- Common > Good design is *not* premature optimization -- Rohit