Summary
We started with understanding the concept of control statements and why they are essential in our day-to-day programming problems. We had a chance to look into two functions range()
and xrange()
that are used to generate a list on-the-fly. We learned about definite loops and indefinite loops. We also learned about the difference between definite and indefinite loops. Under definite loops, we learned about various control statements such as if
, if...else
, if...elif...else
, and for
loop. While, in indefinite loops, we had a chance to study the while statement and how we can also use the while
loop to work as a definite loop. We saw the usage of while with the break
statement and without the break
statement. We also looked into the working of the continue
and pass
statements.
In the next chapter, we will learn about functions and scope of variables.