Difference between revisions of "For"
Jump to navigation
Jump to search
m |
(Created an example for iterating over a range of numbers and an example of iterating over a list.) |
||
Line 4: | Line 4: | ||
[[Category:Keywords]] | [[Category:Keywords]] | ||
− | + | == Example == | |
+ | Iterate over a range of numbers | ||
+ | <ms> | ||
+ | for i in range(1,10) | ||
+ | print i | ||
+ | end for | ||
+ | </ms> | ||
+ | |||
+ | == Example == | ||
+ | Iterate over a list | ||
+ | <ms> | ||
+ | words = ["hello", "MiniScript", "wiki"] | ||
+ | for word in words | ||
+ | print word | ||
+ | end for | ||
+ | </ms> |