help("for")

"""
Explanation: Table of Contents

1. Before Getting Started

1.1 Introduction

2. Create a Custom Calculator
3. What is a Computer Langugage?
4. Quiz Games and If Statements.
5. Guessing Games with Random Numbers and Loops.
6. Introduction to Graphics.
7. Back to Looping.
8. Introduction to Animation.
9. Functions.
10.Controllers and Graphics.
11. Bitmapped Graphics and Sound.
12. Introduction to Classes.
13. Libraries and Modules.
14. Searching.
15. Array-Backed Grids.
16. Sorting.
17. Exceptions.
18. Recursion.
19. Formatting.
20. Labs.
21. Appendix A: Example code and Programs.
22. Appendix B: Sample Tests.
23. Appendix C: Worksheets
24. Appendix D: Version Control.
25. What's next?
Before Getting Started

This is some text
1.1 Introduction

Sub-section.
Create a Custom Calculator
What is a Computer Language?

Here's some more text.
Guessing Games with Random Numbers and Loops

For Loops
Let's see what python has to say about the "for loop"!
End of explanation
"""


%%HTML
<iframe width="800" height="250" frameborder="0" src="http://pythontutor.com/iframe-embed.html#code=for%20i%20in%20range(5%29%3A%0A%20%20%20%20print(%22I%20will%20not%20bow!%22%29&codeDivHeight=400&codeDivWidth=350&cumulative=false&curInstr=0&heapPrimitives=false&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false"> </iframe>

"""
Explanation: Syntax:
"for" target_object "in" expression_list ":"
        "body of the loop"

Points of Interest:


1. Target_object ; Any Python object:

variable
string
tuple
list



2. Expression_list ; is eval only once.


When eval; yields an iterable object.


Consequently; An "iterator" is created.




3. Loop Body / Suit ; is executed once for each item, provided by the iterator.


Performs nessecery ops on expressions within the loop body, mainly assignments.


When the items are exhausted, the iterator raises a "StopIteration" exception.


The suite moves to "else" clause, if present, is executed, and the loop
terminates.
End of explanation
"""


help("range")

"""
Syntax: range( start, stop, stepsize ) -> range object.
"""

# a simple example
for i in range(5):
    print("Hello Again!")
print("Ok bye!")

"""
Explanation: range() function

The python
End of explanation
"""


