Avatar ·

How to divide all integers in the array into separate categories?

📁 List, Advanced Python Topics, question, Useful Tips and Lifehacks

Good day! Interested in such a question.
Suppose that there is such a code:

  a =  list  ( range  ( 1 ,  11 ))   print  (a)   

it will output [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

I have a question: is it possible to somehow split the two-digit number 10 into two separate elements of the list, i.e. to make the list look like this:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0]

If the question is "why" in general, I can explain. b (they are set by the user), then calculate how many times certain numbers are found.