current position:Home>Indentation problem of for loop

Indentation problem of for loop

2022-02-03 01:34:44 CSDN Q & A

a=[[1,2,3],[4,5,6],[7,8,9]]s=0 for c in a:for j in range(3):s+=c[j]print(s)

How do you calculate ?




Refer to the answer 1:
a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]s = 0for c in a:    for j in range(3):        s += c[j]    print(s)



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030134428787.html

Random recommended