Cursor wrote a function that computes the average revenue per order. When
there are no orders yet, it crashes with ZeroDivisionError.
Add a one-line guard so that when orders is 0, the function returns
0 instead of crashing. The script should print avg: 0.
The break is on line 2 — but read the whole snippet first.
⌘↵ runs the editor.read, then continue.
Cursor wrote a function that computes the average revenue per order. When
there are no orders yet, it crashes with ZeroDivisionError.
Add a one-line guard so that when orders is 0, the function returns
0 instead of crashing. The script should print avg: 0.
The break is on line 2 — but read the whole snippet first.
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.