mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
[GDScript/zh-cn] Add for
usage with int (#4478)
This commit is contained in:
parent
6ef1f89a36
commit
4090ae734f
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user