Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Ruby
- a = []
- 3.times{|x| 3.times{|y| a << [x,y] if x != y }}
- # Python
- a = []
- for x in range(3):
- for y in range(3):
- if x != y:
- a += [(x,y)]
- Both produce [[0, 1], [0, 2], [1, 0], [1, 2], [2, 0], [2, 1]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement