Book Image

Python Fundamentals

By : Ryan Marvin, Mark Nganga, Amos Omondi
Book Image

Python Fundamentals

By: Ryan Marvin, Mark Nganga, Amos Omondi

Overview of this book

After a brief history of Python and key differences between Python 2 and Python 3, you'll understand how Python has been used in applications such as YouTube and Google App Engine. As you work with the language, you'll learn about control statements, delve into controlling program flow and gradually work on more structured programs via functions. As you settle into the Python ecosystem, you'll learn about data structures and study ways to correctly store and represent information. By working through specific examples, you'll learn how Python implements object-oriented programming (OOP) concepts of abstraction, encapsulation of data, inheritance, and polymorphism. You'll be given an overview of how imports, modules, and packages work in Python, how you can handle errors to prevent apps from crashing, as well as file manipulation. By the end of this book, you'll have built up an impressive portfolio of projects and armed yourself with the skills you need to tackle Python projects in the real world.
Table of Contents (12 chapters)
Python Fundamentals
Preface

Summary


In this chapter, we have learned about how programs in Python flow. We also learned how to control and branch the flow of a Python program by using the two main control statements, that is, if and while. We have also looked at some practical applications of the two control statements and have seen how they differ in implementation and syntax.

In this chapter, we have also increased our knowledge of looping structures. We have seen the structure of a for loop and looked at practical examples. We have also looked into the range function and how it comes in handy when you need to quickly iterate over a list.

Apart from that, we have also covered how and when to nest loops and how to break out of loops prematurely under different conditions and with differing results by using the break, continue, and pass statements.

Armed with this knowledge, you can now start incorporating more complex structures into your programs.

In the next chapter, we will look at functions and how to define them...