top of page
CPMSE Worked Examples
PLUCK
Write a function called pluck that will take as an input argument a number n and return two output arguments d and p. The first output argument, d, is the first non-zero digit. The second output argument, p, is the number that remains when the first non-zero digit is removed.
Test Cases
Test your code on the following numbers:
-
273
-
-52.9
-
0.01234
bottom of page