You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What if you used for-loops only to address data structures with known size during compilation.
for example:
`sm = 0
mat = [
[1, 2],
[3, 4],
]
for i in range(len(mat)):
for j in range(len(mat[0])):
sm += mat[i][j]
print(sm)`
Could you turn this into (mat[0][0] + mat[0][1]) + (mat[1][0] + mat[1][1])?
Do you think that it would be useful?
Would it bloat the executable too much?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What if you used for-loops only to address data structures with known size during compilation.
for example:
`sm = 0
mat = [
[1, 2],
[3, 4],
]
for i in range(len(mat)):
for j in range(len(mat[0])):
sm += mat[i][j]
print(sm)`
Could you turn this into (mat[0][0] + mat[0][1]) + (mat[1][0] + mat[1][1])?
Do you think that it would be useful?
Would it bloat the executable too much?
Beta Was this translation helpful? Give feedback.
All reactions