input: Write a python function to generate Pythagorean triplets up to a given limit.
  assert list(pythagorean_triplets(10))==[[3, 4, 5], [6, 8, 10]]
  assert list(pythagorean_triplets(15))==[[3, 4, 5], [5, 12, 13], [6, 8, 10], [9, 12, 15]]
  assert list(pythagorean_triplets(20))==[[3, 4, 5], [5, 12, 13], [6, 8, 10], [8, 15, 17], [9, 12, 15], [12, 16, 20]]
output: def pythagorean_triplets(limit):
      triplets = []
      for a in range(1, limit+1):
          for b in range(a, limit+1):
              c = (a**2 + b**2) ** 0.5
              if c.is_integer() and c <= limit:
                  triplets.append([a, b, int(c)])
      return triplets