🔂 For In
Published Aug 4, 2021Updated Sep 9, 2021
Contribute to Docs
🔂 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.
🏁 🍇🍿 🔤cookies🔤 🔤milk🔤 🔤eggs🔤 🔤blueberries🔤 🍆 ➡️ grocery🔂 item grocery 🍇😀 item❗️🍉🍉
The output would be:
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
- Anonymous contributorAnonymous contributor
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Emojicode on Codecademy
Computer ScienceLooking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Includes 6 Courses
With Professional Certification