single
Challenge: Working with Numbers
Swipe to show menu
Swipe to start coding
Imagine a situation where a store launches a promotion: when purchasing 5 items at $17 each, the 6th item is free.
A total of 27 people participated in the promotion.
Calculate the total revenue from this promotion using multiplication.
This task (and the next ones) use a small helper function to check your answer automatically.
You don't need to understand function or return yet — you will learn both later in the course.
Focus only on this line:
return ___;
Replace ___ with your calculation using multiplication.
For example:
return 2 * 10;
Just write your final answer as a math expression after return.
The same pattern will be used in the next challenges, so no need to worry.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat