Pythag

Print all primitive Pythagorean triples up to n
import sys,math n = int(sys.argv[1]) print([(x,y,z) for x in range(1,n+1) for y in range(x,n+1,1) for z in range(y,n+1,1) if x**2 + y**2 == z**2 and math.gcd(x,y) == 1])
 * 1) !/usr/bin/python3