Question 39
Given below is an incomplete implementation of a function that prints out 10 multiples of the input n. Replace each blank with a valid Python expression/statement.
Here is an example:
Note that your code needs to be syntactically correct to gain marks. You cannot use any semi-colon(;) and we will deduct marks if your answer is too long.
Model Solution
- Blank 1:
1, 11- Notice that the sample run prints out multiples of 3 starting from 3 itself, and not 0.
You will need to specify the
startvalue in therange()function to not be0so not to produce a productn * iequal to0.
- Notice that the sample run prints out multiples of 3 starting from 3 itself, and not 0.
You will need to specify the
- Blank 2:
n * i
Another acceptable pair:
- Blank 1:
10 - Blank 2:
n * (i + 1)