loop and condition 3에서 어떤 이유로 i와 score를 동일시하지 않으셨는 궁금합니다.
120
demitr8
작성한 질문수 3
0
'''kor_score = [49,79,20,100,80]
math_score = [43,59,85,30,90]
eng_score = [49,79,48,60,100]
midterm_score = [kor_score,math_score,eng_score]
for i in range (0,5):
total_score=0
for j in range(0,3):
print(midterm_score[j][i])
current_score = midterm_score[j][i] #print("current score is "+"["+str(j)+"]"+"["+str(i)+"]"+ str(current_score))
total_score = total_score + current_score
#print("current total score is "+ str(total_score))
average_score=total_score/3
print("average_score of " + str(i) + " is " + str(average_score))'''
저는 이렇게 코드를 짰는데 강사님이 짠것과 많이 달라서 여쭈어 봅니다. for loop을 쓸대 결과물 변수를 for 과 in 사이에 그대로 넣는것이 일반적인가요? 전 i나 j같은 변수가 함수를 통해 나오는 것을 결과값으로 잡는 다고 생각하고 있었기에 score라는 결과변수를 for 조건문에서 봐서 의외였던것 같습니다.
답변 0
케이테스트 서버 운영 방법
2
51
1
강의 추천해주세요
2
28
1
네트워크 전체 흐름 복습 질문
1
34
3
Sequence 관련 질문
1
32
2





