Slide 1

Slide 1 text

Intro to Python by Shuai Liu

Slide 2

Slide 2 text

agenda • History & Basics • Advanced & Be Pythonic • Awesome Python Frameworks

Slide 3

Slide 3 text

History & Basics

Slide 4

Slide 4 text

“I wrote Python.” ——Guido van Rossum

Slide 5

Slide 5 text

What’s Python? • Dynamic, strongly typed script language • Object Oriented & Procedure Oriented & Functional • Open source • Simple & Beautiful & Fast high-level interpreted script

Slide 6

Slide 6 text

What I could do with Python?

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Who uses Python?

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Let’s touch it slightly… • Whitespace (Tab? No!) • A combination of reference counting and a cycle- detecting garbage collector • 2.x vs. 3.x • >>> import this

Slide 11

Slide 11 text

When we learning a language… s,  e,  q,  u,  e,  n,  c,  e {          “map”:  “”   } “String” 28.53 function() if else for/while class

Slide 12

Slide 12 text

After that, you can use a language like C

Slide 13

Slide 13 text

variable • number: int & float & bool • string • …

Slide 14

Slide 14 text

Let’s see dynamic… dynamic

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

some powerful built-in functions • type • str • int • float

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Sequence • string • list • tuple

Slide 19

Slide 19 text

built-in functions • len • enumerate • zip

Slide 20

Slide 20 text

Something more…

Slide 21

Slide 21 text

Slice • [ : ] • [ : : ]

Slide 22

Slide 22 text

dict

Slide 23

Slide 23 text

built-in functions • dict.update(dict2) • dict.keys() • dict.fromkeys(seq, val=None)

Slide 24

Slide 24 text

function

Slide 25

Slide 25 text

branch & loop

Slide 26

Slide 26 text

Thanks