官术网_书友最值得收藏!

Introduction

Our experience with computers is a machine with a huge volume of carefully organized logic. No one piece of this logic is necessarily complex or can capture what drives the result. Rather, the entire system is organized such that it comes together to provide the output you expect.

In previous chapters, you focused on the basic Python idioms and data types. In this chapter, you will begin exploring more abstract concepts regarding how knowledge is formalized through logic in Python. You will explore a few fundamental algorithms that are used for solving typical problems in computer science, along with some simple logic.

For example, consider the problem of sorting a list of integers. Supermarkets use sorting techniques to sort through their customers to get an insight into the sales an individual customer provides. You may be surprised at the theoretical complexity behind writing such an algorithm in an efficient manner.

In this chapter, you will also learn about a few of the paradigms in Python for expressing our code in a concise but readable way. You will discuss the habits of a good programmer, and how to make sure you write code that is maintainable and does not repeat itself. In doing so, you can ensure yourself against needing to rework your code unnecessarily, as requirements change constantly in the IT world.

This chapter begins by moving away from running code in the Python shell and toward Python scripts and modules. This will allow us more flexibility to write clear, reusable, and powerful code.

主站蜘蛛池模板: 云阳县| 嘉黎县| 丰台区| 台中县| 汝阳县| 河源市| 昌吉市| 长海县| 宜城市| 楚雄市| 宁蒗| 辽阳县| 东至县| 大丰市| 榆树市| 盘锦市| 陈巴尔虎旗| 大冶市| 永春县| 南岸区| 福泉市| 湛江市| 修武县| 女性| 盐亭县| 全州县| 灵璧县| 辛集市| 杂多县| 南阳市| 常州市| 青龙| 德钦县| 楚雄市| 吉林省| 辉县市| 岑巩县| 友谊县| 长沙县| 托里县| 青冈县|