n = int(input('Enter your number here: '))
list1 = []
for i in range(1,n+1):
for j in range(1,n+1):
for k in range(1,n+1):
if i **2 +j**2 == k**2:
list1.append([i,j,k])
list2 = [sorted(x) for x in list1]
set1 = [tuple(x) for x in list2]
set2 = set(set1)
set3 = [list(j) for j in set2]
len(set3)
Comments
Leave a comment