Python For Dummies
eBook - ePub

Python For Dummies

Stef Maruch, Aahz Maruch

Share book
  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Python For Dummies

Stef Maruch, Aahz Maruch

Book details
Book preview
Table of contents
Citations

About This Book

Python is one of the most powerful, easy-to-read programming languages around, but it does have its limitations. This general purpose, high-level language that can be extended and embedded is a smart option for many programming problems, but a poor solution to others.

Python For Dummies is the quick-and-easy guide to getting the most out of this robust program. This hands-on book will show you everything you need to know about building programs, debugging code, and simplifying development, as well as defining what actions it can perform. You'll wrap yourself around all of its advanced features and become an expert Python user in no time. This guide gives you the tools you need to:

  • Master basic elements and syntax
  • Document, design, and debug programs
  • Work with strings like a pro
  • Direct a program with control structures
  • Integrate integers, complex numbers, and modules
  • Build lists, stacks, and queues
  • Create an organized dictionary
  • Handle functions, data, and namespace
  • Construct applications with modules and packages
  • Call, create, extend, and override classes
  • Access the Internet to enhance your library
  • Understand the new features of Python 2.5

Packed with critical idioms and great resources to maximize your productivity, Python For Dummies is the ultimate one-stop information guide. In a matter of minutes you'll be familiar with Python's building blocks, strings, dictionaries, and sets; and be on your way to writing the program that you've dreamed about!

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Python For Dummies an online PDF/ePUB?
Yes, you can access Python For Dummies by Stef Maruch, Aahz Maruch in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Desarrollo de software. We have over one million books available in our catalogue for you to explore.

Information

Publisher
For Dummies
Year
2011
ISBN
9781118084847
Part I

Getting Started

In this part . . .
**IN a DROPCAP**
You get an overview of the Python programming language, an introduction to its interactive and developer environment, and a walkthrough of the building blocks that make up Python programs.
Chapter 1 describes the history of Python and all the exciting things it’s being used for today. You find out why computers are both the fastest and dumbest things around. Best of all, you discover why it’s called Python anyway.
Chapter 2 lets you talk to Python via its interactive mode and IDLE environment. You write a few basic programs and find out how to get Python to carry out commands for you, how to get Python to tell you things, and how to import tools that let you do even more.
Chapter 3 introduces you to Python’s data types and code blocks, the chunks you use to build programs.
Chapter 4 shows you a working program. You see how all the chunks of a Python program talk to each other, and you find out something about the design philosophies behind Python programs.
Chapter 5 lets you try on a programmer’s hat to understand how programmers work and why they make the design decisions they do. (Unfortunately, it doesn’t explain the relevance of caffeinated sodas to this process — you’ll have to figure that out for yourself.) There’s also a very useful section on strategies for debugging programs, which is a huge part of every programmer’s job.
Chapter 1

Introducing Python

In This Chapter

bullet
The history of Python
bullet
What people use Python for
bullet
Useful concepts for Python programming
Welcome to Python! If you’re the type of person who wants to know what you’re getting into, this chapter is for you. We give you a quick history of Python and its community of developers. You find out what Python is and isn’t good for (the “is” section is much longer than the “isn’t” section) and the most important principles of good Python programming. If you’re new to programming, you’ll see how it’s very similar to a task you’re probably familiar with.

The Right Tool for the Job

Python is a general-purpose, high-level language that can be extended and embedded (included in applications as a tool for writing macros). That makes Python a smart choice for many programming problems, both small and large, and not so good for a couple of computing tasks.

Good uses of Python

Python is ideal for projects that require quick development. It supports multiple programming philosophies, so it’s good for programs that require flexibility. The many packages and modules already written for Python provide versatility and save you time.

The story of Python

Guido van Rossum created Python and is affectionately bestowed with the title “Benevolent Dictator For Life” by the Python community. In the late 1980s, Guido liked features of several programming languages, but none of them had all the features he wanted. Specifically, he wanted a language that had the following features:
bullet
Scripting language: A script is a program that controls other programs. Scripting languages are good for quick development and prototyping because they’re good at passing messages from one component to another and at handling fiddly stuff like memory management so that the programmer doesn’t have to. Python has grown beyond scripting languages, which are used mostly for small applications. The Python community prefers to call Python a dynamic programming language.
bullet
Indentation for statement grouping: Python specifies that several statements are part of a single group by indenting them. The indented group is called a code block. Other languages use different syntax or punctuation for statement grouping. For example, the C programming language uses { to begin an instruction and } to end it. Indentation is considered good practice in other languages also, but Python was one of the first to enforce indentation. Indentation makes code easier to read, and code blocks set off with indentation have fewer begin/end words and punctuation to accidentally leave out (which means fewer bugs).
bullet
High-level data types: Computers store everything in 1s and 0s, but humans need to work with data in more complex forms, such as text. A language that supports such complex data is said to have high-level data types. A high-level data type is easy to manipulate. For exam...

Table of contents