Splitting Up Numbers

Published by Matt in

Create a function that takes a number num and returns each place value in the number.

Examples

num_split(39) ➞ [30, 9]

num_split(-434) ➞ [-400, -30, -4]

num_split(100) ➞ [100, 0, 0]

Notes

N/A

Watch a quick demo on how Edabit works.