title: how to use itertools methods so that they show all possible combinations
body: <p>I need to find absolutely all possible combinations, including taking into account their position.
  for example, the combination 222, 200, 220 does not come out in any way. what else can be done?</p>
  <p>Here is mu code:</p>
  <pre><code>import itertools
  
  real_code = '220'
  code = itertools.permutations('012', r=3)
  set_of_code = set()
  for i in code:
      set_of_code.add(''.join(i))
      # print('permut', i)
  
  code2 = itertools.combinations_with_replacement('012', r=3)
  for i in code2:
      set_of_code.add(''.join(i))
      # print('comboW', i)
  
  for i in set_of_code:
      if i == real_code:
          print('found', i)
          break
  else:
      print('not found')
  </code></pre>