-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathfor1.py
More file actions
55 lines (40 loc) · 765 Bytes
/
for1.py
File metadata and controls
55 lines (40 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from lpython import i32
# fruits = ["apple", "banana", "cherry"]
for x in fruits:
print(x)
for x in fruits:
print(x)
if x == "banana":
break
for x in "banana":
print(x)
for i in range(6):
print(i)
for i in range(2, 30, 3):
print(i)
for i in range(5):
if i == 3: continue
print(i)
else:
print("Finally Completed!")
for i in range(5):
for j in range(5):
print(i, j)
sum: i32 = 0
for j in range(5):
sum += j
for _, x in y:
pass
for (x, y) in z:
pass
for i, a in enumerate([4, 5, 6, 7]):
print(i, ": ", a)
# For-loops with type-comment
for i in range(5): # type: int
pass
for j in k: # type: List[str]
pass
for i in range(5): # type:int
pass
else:
pass