mirror of
https://github.com/erg-lang/erg.git
synced 2025-07-09 22:25:22 +00:00
13 lines
211 B
Python
13 lines
211 B
Python
arr = [0, 1, 2]
|
|
zeros = [0; 3]
|
|
|
|
assert arr[0] == 0
|
|
assert zeros[2] == 0
|
|
|
|
print! arr[3] # This will result in a compile-time error!
|
|
|
|
mut_arr = ![]
|
|
for! 0..<10, i =>
|
|
mut_arr.push! i
|
|
|
|
assert sum(mut_arr) == 45
|