mat = [[1,21],
      [10, 3],
      [5, 4],
      [35,12]]
min_sum = mat[0][0] + mat[0][1]
min_index = 0
for j in range(1,4):
    current_sum = mat[j][0] + mat[j][1]
    if current_sum < min_sum:
        min_sum =  current_sum
        min_index = j
print(f"각 행의 합계 중 가장 작은 값: {min_sum}")
print(f"가장 작은 합계를 가진 행의 인덱스: {min_index}")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: