Skip to content

Commit 972afc1

Browse files
committed
update while sample
1 parent 9efe020 commit 972afc1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

samples/basic/do_while.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@
88
sum = sum + n
99
n = n + 1
1010
print(sum)
11+
12+
# 计算1x2x3x...x100:
13+
acc = 1
14+
n = 1
15+
while n <= 100:
16+
acc = acc * n
17+
n = n + 1
18+
print(acc)

0 commit comments

Comments
 (0)