개발자 톡
연습문제 톡
진정한 효도
파이썬 완성 답 코드 공유
- 등록일
- 2024-02-23 15:08:02
- 조회수
- 520
- 작성자
- jojo9712
import sys
row = []
result_list = []
for i in range(3):
row = list(map(int, input().split()))
result_list.append(row)
result = 0
min = 9999
#########################################
for i in range(len(result_list)):
row = result_list[i]
if len(set(row)) == 1:
min = 0
break;
else:
base = row[0]
for value in (row):
if value != base:
if abs(base-value) < min:
min = abs(base-value)
for col in range(3):
col_value = [row[col] for row in result_list]
if len(set(col_value)) == 1:
min = 0
break;
else:
base = col_value[0]
for value in (col_value):
if value != base:
if abs(base-value) < min:
min = abs(base-value)
print(min)
#진정한_효도