0
Putting every digital separately
What would be the code to place every entered code in a separate placeholder or something. Like 1234 when entered will be placed as 1 2 3 and 4 in separate cells
1 ответ
+ 3
to help you we need to know what programming language you expect to do this for you.
if you are talking about phyton you can do:
sep_inp = list(input(‘Value:’)
so input 1234 gives a list:
['1', '2', '3', '4'], this is a list of strings you can iterate with a for loop.
if you want to get the list items as int instead of string you can do this:
sep_inp = list(map(int, input(‘Value’)))
this gives:
[1, 2, 3, 4]
the same result can also be achived with:
sep_inp = [int(x) for x in input(‘Value’)]