fork download
  1. import random
  2.  
  3.  
  4. def comb(big, small):
  5. return 1 if small == 0 or small == big else comb(big - 1, small - 1) + comb(big - 1, small)
  6.  
  7. univ = 2 ** random.randint(1, 5)
  8.  
  9. for big in range(univ):
  10. for small in range(big + 1):
  11. print(comb(big, small), end=" ")
  12. print()
Success #stdin #stdout 0.12s 14272KB
stdin
Standard input is empty
stdout
1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 
1 6 15 20 15 6 1 
1 7 21 35 35 21 7 1