A_Byte_Of_Python_1

来源:互联网 发布:java识别图片中文文字 编辑:程序博客网 时间:2024/06/18 17:18

A byte of Python

Success in life is a matter not so much of talent and opportunity as of concentration and perseverance.

​ —- C.W. Wendte

Chapter 2. Introduction

Features of Python

  • Simple
  • Easy to Learn
  • Free and Open Source
  • High-level Language
  • Portable
  • Interpreted
  • Object Oriented
  • Extensible
  • Embeddable???
  • Extensive Libraries

Chapter 4. First Steps

  • Vim
  • PyCharm
  • Emacs

Chapter 5. Basics

print("Hello, World!") #Note that print is a statement
  • Constant:
    • Numbers: (integers and float)
    • Strings: (immutable)
    • Single quote
    • double quote
    • triple quote: for multi-line string.
    • format method
      • format()
      • '{0:.3f}'.format(1.0/3)
      • '{0:_^11}'.format('Hello')
    • escape sequences:\\ \n \t
    • Raw string: no special processing
  • Variable:
  • Data Types:
    • numbers
    • strings
    • classes
  • Object
#程序可以换行s = 'this is a string.\This continues the string.'print(s)#same as print(\    s)
原创粉丝点击