Pybites Logo

N digit numbers

Level: Beginner (score: 2)

Write a function that accepts a list of numbers and converts them into n digit integers.

Examples:  

n_digit_numbers([1, 2, 3], 2)  => [10, 20, 30]

n_digit_numbers([8, 9, 10], 2)  => [80, 90, 10]

n_digit_numbers([-1.1, 2.22, -3.333], 3)  => [-110, 222, -333]

Note: Negative numbers should keep their negativity and calling the function with n < 1 should raise a ValueError.