Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- columns, values = map(int,input().split())
- def f(s,column):
- for i in range(1,values+1):
- if column >= columns:
- print(s,i)
- else:
- if s:
- f(s+' ' + str(i),column+1)
- else:
- f(str(i),column+1)
- f('',1)
Advertisement
Add Comment
Please, Sign In to add comment