Browse Source

Document 'for' treatment of a bare number as a 'range()'

Dan Boorstein 6 years ago
parent
commit
b4fb258356
1 changed files with 6 additions and 0 deletions
  1. 6 0
      getting_started/scripting/gdscript/gdscript_basics.rst

+ 6 - 0
getting_started/scripting/gdscript/gdscript_basics.rst

@@ -842,6 +842,12 @@ in the loop variable.
     for c in "Hello":
         print(c) # Iterate through all characters in a String, print every letter on new line.
 
+    for i in 3:
+        statement # Similar to range(3)
+
+    for i in 2.2:
+        statement # Similar to range(ceil(2.2))
+
 match
 ^^^^^