3 Matching Annotations
  1. Oct 2025
    1. Nested for loops

      Collin Mitchell ``` num = 0

      for x in range(1, 101): for y in range(1, 101): x1 = x ** 2.0 y1 = y ** 2.0 z = (x1 + y1) ** 0.5 if round(z) == z: # check if z has a decimal print(f"({x})^2 + ({y})^2 = ({int(z)})^2") num += 1

      print(f"Number of combinations: {num}") ```

    2. Collin Mitchell ``` num = 0

      for x in range(1, 101): for y in range(1, 101): x1 = x ** 2.0 y1 = y ** 2.0 z = (x1 + y1) ** 0.5 if round(z) == z: # check if z has a decimal print(f"({x})^2 + ({y})^2 = ({int(z)})^2") num += 1

      print(f"Number of combinations: {num}") ```

    3. Collin Mitchell

      ``` letters = "abcdefghijklmnopqrstuvwxyz"

      num = 0 l1 = -1 l2 = 0 l3 = 0

      while l3 <= 25: # increases letter 1 by 1 index l1 += 1 num = 0 if l1 == 26: # resets letter 1 to a, increases letter 2 index by 1 l2 += 1 l1 = 0 if l2 == 26: # resets letter 2 to a, increases letter 3 index by 1 l3 += 1 l2 = 0 if l3 > 25: # stops code when reaching above z on letter 3 break while num <= 9999: # loops, increasing number by 1 each time, until all 9999 numbers have been reached print(f"{letters[l1]}{letters[l2]}{letters[l3]}", f"{num:03d}") num += 1 ```