Skip to content

Navigation Menu

Sign in
Sign up

for-loops #297

Karilli started this conversation in Ideas
May 18, 2024 · 0 comments
Discussion options

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?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /