Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. Introduction to Python > An overview of Python

2.1. An overview of Python

As we mentioned earlier, Python supports several different programming techniques. For simple tasks, which there may be many of in a complex program, functions can be more appropriate than making everything a class. Functional programming can make it hard for others to follow your code if it’s overused, but it can also be extremely powerful. With Python, you’re free to mix procedural, functional, and object-oriented programming to your heart’s delight; and, because they all have their place, you probably will. First things first, though—to do this, you need to know the language.

The core object model of Python is similar to imperative languages such as C#, Java, and VB.NET.[4] If you’ve used any of these languages before, even if aspects of the syntax are unfamiliar, you’ll find learning Python easy. Python does differ from these languages in how it delimits blocks of code. Instead of using curly braces, Python uses indentation to mark blocks of code. Here’s a simple example using an if block:

[4] Whereas languages like Ruby inherit more from Smalltalk in their core object model.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial