Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Python-intro-2
Search
Shuai Liu
December 23, 2014
Programming
97
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Python-intro-2
Shuai Liu
December 23, 2014
More Decks by Shuai Liu
See All by Shuai Liu
Auto-Layout.pdf
liushuaikobe
2
150
Python-intro-1
liushuaikobe
0
95
GitRadar——毕业论文答辩
liushuaikobe
0
250
NoSQL & MongoDB
liushuaikobe
0
220
Other Decks in Programming
See All in Programming
ジョジョの世界をXRで再現する
mofurune
0
160
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
980
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
790
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
330
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
410
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
カツオ、ご期待ください
suneo3476
0
180
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
Domain-Driven Transformation
hschwentner
2
2.3k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Become a Pro
speakerdeck
PRO
31
6.3k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
410
Designing for Timeless Needs
cassininazir
1
520
Building AI with AI
inesmontani
PRO
1
1.3k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
A Modern Web Designer's Workflow
chriscoyier
699
190k
Claude Code のすすめ
schroneko
67
230k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Transcript
Intro to Python by Shuai Liu
agenda • History & Basics • Advanced & Be Pythonic
• Awesome Python Frameworks
Advanced & Be Pythonic
Review • int & float & bool • string &
list & tuple • dict • loop & branch • def methods
Something interesting…
def foo(a, b): """My niubility methods.""" return a + b
"""My niubility methods.""" >>> print foo.__doc__ >>> My niubility methods.
class Person(object): """My first class""" version = 1.0 def __init__(self,
name): self.name = name print "__init__ called" def get_name(self): """Return the name""" return self.name
Pythonic
–Martijn Faassen, founder of the lxml (XML library for Python)
“Pythonic is to use the Python constructs and datastructures with clean, readable idioms.”
enumerate l = [0, 1, 2, 3, 4] for i
in range(len(l)): print i, l[i] for i, element in enumerate(l): print i, element
value exchange temp = foo foo = bar bar =
temp foo, bar = bar, foo
string concatenating s = “hello” + “world” s = “”.join([“hello”,
“world”])
λ
lambda def foo(x): return x ** 2 lambda x :
x ** 2 >>> a = lambda x : x ** 2 >>> a(5) >>> 25
filter & map & reduce
>>> filter(function, iterable) >>> map(function, iterable) >>> reduce(function, iterable)
filter
map
reduce
None
List comprehensions
>>> a = map(lambda x : x ** 2, range(10))
>>> a = [ x ** 2 for x in range(10)] >>> a = filter(lambda x : x % 2, range(10)) >>> a = [x for x in range(10) if x % 2]
None
two more things…
PEP
Python Enhancement Proposals num title owner 1 PEP Purpose and
Guidelines Warsaw, Hylton, Goodger, Coghlan 4 Deprecation of Standard Modules von Löwis 5 Guidelines for Language Evolution Prescod 8 Style Guide for Python Code GvR, Warsaw, Coghlan
pip
pip • A tool for installing and managing Python packages.
• $ sudo pip install Requests
Resources
None
IDE ‘+’.join([ , ])
IDE
Summary • OO • lambda & three functions • list
comprehensions • resources
Thanks