FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/integration_tests/array_expr_09.py at refs/heads/main · lcompilers/lpython · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
lcompilers
/
lpython
Public
Notifications
You must be signed in to change notification settings
Fork
176
Star
1.6k
Code
Issues
500
Pull requests
80
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
lpython
/
integration_tests
/
array_expr_09.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (20 loc) · 510 Bytes
Breadcrumbs
lpython
/
integration_tests
/
array_expr_09.py
Copy path
File metadata and controls
23 lines (20 loc) · 510 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from
lpython
import
(
i32
,
Const
)
from
numpy
import
empty
,
int32
dim
:
Const
[
i32
]
=
2
dim2
:
Const
[
i32
]
=
3
def
g
():
a
:
i32
[
dim
,
dim2
]
=
empty
((
dim
,
dim2
),
dtype
=
int32
)
i1
:
i32
=
0
i2
:
i32
=
0
for
i1
in
range
(
dim
):
for
i2
in
range
(
dim2
):
a
[
i1
,
i2
]
=
i32
(
i1
*
dim2
+
i2
)
# a: [[0, 1, 2], [3, 4, 5]]
print
(
a
)
assert
a
[
-
1
,
-
1
]
==
5
assert
a
[
-
1
,
-
2
]
==
4
assert
a
[
-
1
,
-
3
]
==
3
assert
a
[
-
2
,
-
1
]
==
2
assert
a
[
-
2
,
-
2
]
==
1
assert
a
[
-
2
,
-
3
]
==
0
g
()
Back
|
FazBrowse Home
|
New Git URL