Range Functions
Guido states that "If you do need to iterate over a sequence of numbers, the built-in function
range()
comes in handy. It generates arithmetic
progressions." (Guido Van Rossum 4.3)
Here is an example of the Range function:
With the range function it stated that for I in range between 0-5 print I and when the sequence is entered, the range between 0-5 is "printed".
Here is my take on the function:
As stated previously I is in range between 0-15 and when the sequence is executed the function entered 15 numbers!
Else Clauses
Loop statements may have an else clause. which is executed when the loop terminates through exhaustion of the list (with for) or when the condition becomes false (with while), but not when the loop is terminated by a break statement. Here is an example to better understand the statement.
And now is my take on this sequence:
0 comments:
Post a Comment