Emojicode ๐Ÿ”‚ For In

christian.dinh's avatar
Published Aug 4, 2021Updated Sep 9, 2021
Contribute to Docs

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.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • ๐Ÿ‡ Learn about Emojicode, a programming language that consists of emojis! ๐Ÿ‰
    • Beginner Friendly.
      1 hour

Syntax

๐Ÿ ๐Ÿ‡
๐Ÿฟ ๐Ÿ”คcookies๐Ÿ”ค ๐Ÿ”คmilk๐Ÿ”ค ๐Ÿ”คeggs๐Ÿ”ค ๐Ÿ”คblueberries๐Ÿ”ค ๐Ÿ† โžก๏ธ grocery
๐Ÿ”‚ item grocery ๐Ÿ‡
๐Ÿ˜€ itemโ—๏ธ
๐Ÿ‰
๐Ÿ‰

The output would be:

cookies
milk
eggs
blueberries

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 ๐Ÿ”ก.

All contributors

Contribute to Docs

Learn Emojicode on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • ๐Ÿ‡ Learn about Emojicode, a programming language that consists of emojis! ๐Ÿ‰
    • Beginner Friendly.
      1 hour