๐ For In
The ๐
statement allows you to quickly iterate over an instance, that is repeatedly retrieving values from it until there are no more values to provide.
For example, you can iterate over an ๐จ
instance and youโll receive all elements contained in the list.
Syntax
๐ ๐๐ฟ ๐คcookies๐ค ๐คmilk๐ค ๐คeggs๐ค ๐คblueberries๐ค ๐ โก๏ธ grocery๐ item grocery ๐๐ itemโ๏ธ๐๐
The output would be:
cookiesmilkeggsblueberries
In this example, the code block will be repeated for every value of the list and the values are printed. The type of item
is naturally ๐ก
.
Contributors
- Anonymous contributors