Book contents
- Frontmatter
- Contents
- Image Credits
- Introduction
- Downloading Python
- Some Tips
- Part I Learning Python
- Challenges 1–11 The Basics
- Challenges 12–19 If Statements
- Challenges 20–26 Strings
- Challenges 27–34 Maths
- Challenges 35–44 For Loop
- Challenges 45–51 While Loop
- Challenges 52–59 Random
- Challenges 60–68 Turtle Graphics
- Challenges 69–79 Tuples, Lists and Dictionaries
- Challenges 80–87 More String Manipulation
- Challenges 88–95 Numeric Arrays
- Challenges 96–103 2D Lists and Dictionaries
- Challenges 105–110 Reading and Writing to a Text File
- Challenges 111–117 Reading and Writing to a .csv File
- Challenges 118–123 Subprograms
- Challenges 124–132 Tkinter GUI
- Challenges 133–138 More Tkinter
- Challenges 139–145 SQLite
- Part II Chunky Challenges
- What Next?
- Glossary
- Index
Challenges 35–44 - For Loop
from Part I - Learning Python
Published online by Cambridge University Press: 28 May 2019
- Frontmatter
- Contents
- Image Credits
- Introduction
- Downloading Python
- Some Tips
- Part I Learning Python
- Challenges 1–11 The Basics
- Challenges 12–19 If Statements
- Challenges 20–26 Strings
- Challenges 27–34 Maths
- Challenges 35–44 For Loop
- Challenges 45–51 While Loop
- Challenges 52–59 Random
- Challenges 60–68 Turtle Graphics
- Challenges 69–79 Tuples, Lists and Dictionaries
- Challenges 80–87 More String Manipulation
- Challenges 88–95 Numeric Arrays
- Challenges 96–103 2D Lists and Dictionaries
- Challenges 105–110 Reading and Writing to a Text File
- Challenges 111–117 Reading and Writing to a .csv File
- Challenges 118–123 Subprograms
- Challenges 124–132 Tkinter GUI
- Challenges 133–138 More Tkinter
- Challenges 139–145 SQLite
- Part II Chunky Challenges
- What Next?
- Glossary
- Index
Summary
Iteration allows code to be repeated and this chapter shows the reader how to create count-controlled loops (using for loops) that implement the range expression. They complete ten challenges ensuring they are familiar with using iteration in their coding.
- Type
- Chapter
- Information
- Python by ExampleLearning to Program in 150 Challenges, pp. 35 - 39Publisher: Cambridge University PressPrint publication year: 2019