summaryrefslogtreecommitdiffhomepage
path: root/zh-cn
diff options
context:
space:
mode:
authorwczcw <shiftwatchout@gmail.com>2022-08-17 20:01:12 +0800
committerGitHub <noreply@github.com>2022-08-17 20:01:12 +0800
commit4090ae734f2c4cd6ef900a7e0bc265028031236f (patch)
treea229e65c4fa6f530886d1dea8b341a76301c68b4 /zh-cn
parent6ef1f89a36784938ae1a1f5bdfbcf0bfc723b2d1 (diff)
[GDScript/zh-cn] Add `for` usage with int (#4478)
Diffstat (limited to 'zh-cn')
-rw-r--r--zh-cn/gdscript-cn.html.markdown3
1 files changed, 3 insertions, 0 deletions
diff --git a/zh-cn/gdscript-cn.html.markdown b/zh-cn/gdscript-cn.html.markdown
index 3405bb8d..7c731533 100644
--- a/zh-cn/gdscript-cn.html.markdown
+++ b/zh-cn/gdscript-cn.html.markdown
@@ -111,6 +111,9 @@ func control_flow():
for i in range(20): # GDScript 有类似 Python 的 range 函数
print(i) # 所以这句将打印从 0 到 19 的数字
+ for i in 20: # 与 Python 略有不同的是,你可以直接用一个整型数开始循环
+ print(i) # 所以这行代码也将打印从 0 到 19 的数字
+
for i in ["two", 3, 1.0]: # 遍历数组
print(i)