Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
py-quickstart/docs/Iteration/intro-to-iteration.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18 lines (8 sloc)
754 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Iteration | |
{{ todo("Actually write this") }} | |
Anytime you want to do anything more than once in a Python program, you should consider putting it inside a loop. | |
There are two types of loops in python, a 'for' loop and a 'while' loop. Generally 'for' loops are used when you know the amount of times you want to repeat something. It doesn't have to be an exact integer value, it can also be anything easily calculable. 'While' loops are used when you aren't sure how many times you need to repeat something, this could be to repeat something until a condition is reached or until a user tells it to stop. | |
- [For loops](./for-loops/README.md) | |
- [While loops](./while-loops/README.md) | |
Also, recursion | |
- [Recursion](./recursion/README.md) | |