Multiples Up To
Return a list of all the multiples of k from k up to n (including n if it is a multiple), smallest first. If k is bigger than n, return an empty list. Hint: np.arange takes a start, a stop and a step.
Example 1
k 3
n 10
returns [3,6,9]
3, 6 and 9 are the multiples of 3 up to 10.
Constraints
1 <= k <= 201 <= n <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Overlap CountBeginner
- Pass or FailBeginner
- Percent of TotalBeginner
- Pick ItemsBeginner
- Price With TaxBeginner
- Range of ReadingsBeginner
- Recent AverageBeginner
- Running TotalBeginner