N=5
Input: 12345
Output: [1,2,3,4,5]
Iterate through input string (using For loops) and create array (using List).
No need for map
or lambda
, you can just use the list()
function or list comprehension;
an_array = input()
>>> 12345
print([int(x) for x in an_array])
>>> [1, 2, 3, 4, 5]