Avatar ·

How to get all the combinations of numbers in Python correctly

📁 python, ии

there is a code:

   IMPORT  ITERTOOLS  for  i  in  itertools.combinations_with_replacement ( '' 0123456789 ',  4 ):   print  ( '' ' .join (i))     

I need to get all the combinations of 4 numbers with repetitions. Part of the output of the program:

   0000  000100020003000500060007000800090011001200 130014001500160017001800190022002300240025    

Tell me, tell me Why after 0009 there is 0011 , and not 0010 ? Also with 0022 .