Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- existing_nums = []
- tuples = []
- duplicates = 0
- n = 10
- switch = True
- counter = 0
- for i in range(1,n):
- for j in range(1,n):
- for k in range(1,n):
- if set([i,j,k]) not in tuples:
- tuples.append(set([i,j,k]))
- if i != j != k and i != k != j:
- num = i * j * k
- if num in existing_nums:
- duplicates += 1
- else:
- print(i,j,k)
- existing_nums.append(num)
- counter += 1
- else:
- pass
- print(duplicates)
- print(existing_nums)
- print(counter)
Advertisement
Add Comment
Please, Sign In to add comment