If—elif—else statements - Your turn#
If you really love apples, you can purchase a pre-packaged box with \(30\) apples for \(\$15\). Modify the code from the demo to include this offer. Test your code for each of the following cases: \(n = 3\), \(11\), \(22\) and \(30\). For each \(n\), compute the cost by hand and then compare it to the result obtained by running your script.
Hint: Recall that checking for equality requires the ==
operator.
# TODO: Write your solution below
TODO: Write the cost for each value of \(n\) below#
Exporting your work#
When you’re ready, the easiest way to export the notebook is to File > Print
it and save it as a PDF.
Remove any excessively long, unrelated outputs first by clicking the arrow → next to the output box and then Show/hide output
.
Obviously don’t obscure any necessary output or graphs!