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

  • Python Essentials
  • Steven F. Lott
  • 196字
  • 2021-07-16 13:53:11

Chapter 3. Expressions and Output

Expressions are central to Python programming. As noted in Chapter 1, Getting Started, Python has a rich collection of operators and built-in functions. In this chapter, we'll summarize the relationship between data types and the operators they support.

Perhaps the most fundamental program possible is one that performs a calculation and displays output. To demonstrate this, we'll look at the print() function in this chapter. We'll expand on the basics by looking at a number of ways to produce nicely-formatted text output.

We'll need to look in detail at the Python syntax rules. This will be essential for writing scripts with more complex sequences of statements. It will also set the stage for looking at compound statements in Chapter 5, Logic, Comparisons, and Conditions.

This chapter will also demonstrate some additional string processing techniques. We'll summarize some of the standard library modules that are focused on string processing. We'll look closely at the re module; we use this to build regular expressions that help parse string input. Between the built-in methods of the str class, and the re module, we can handle a wide variety of text input conversion.

主站蜘蛛池模板: 清涧县| 安阳市| 深泽县| 怀集县| 错那县| 长阳| 霍州市| 汽车| 临夏县| 旬邑县| 福贡县| 三台县| 南木林县| 德钦县| 吉水县| 柞水县| 顺昌县| 固原市| 南丰县| 绥阳县| 宝清县| 赣州市| 三穗县| 邯郸市| 乐业县| 台江县| 定州市| 四川省| 山东| 临湘市| 海伦市| 乡城县| 吴堡县| 礼泉县| 南澳县| 合阳县| 九龙坡区| 深州市| 新绛县| 海阳市| 洞口县|