-1

N=5

Input: 12345

Output: [1,2,3,4,5]

  • See [ask]. You need to show what you tried as a [mcve]. No one here wants to write this code for you. ("python parse a number into a list" makes a good web search if you really just want to copy a solution off the internet. But why not give it a try yourself?) –  Oct 30 '18 at 15:24

2 Answers2

0

Iterate through input string (using For loops) and create array (using List).

elixenide
  • 44,308
  • 16
  • 74
  • 100
0

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]
Nordle
  • 2,915
  • 3
  • 16
  • 34