Guest User

lol

a guest
Oct 8th, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. def rec(arr):
  2.     for i in range(len(arr)):
  3.         if arr[i] == '_':
  4.             arr[i] = 0
  5.             rec(arr.copy())
  6.             arr[i] = 1
  7.             rec(arr.copy())
  8.             break
  9.         if i == len(arr) - 1:
  10.             print(arr)
  11.  
  12. arr = [0, '_', '_', 1, '_']
  13. rec(arr)
  14.  
Advertisement
Add Comment
Please, Sign In to add comment