/python是1989年,Guido von Rossum在圣誕節(jié)閑著無聊開發(fā)的.(無聊果真是最大生產(chǎn)力)
/python的優(yōu)點:balabalabala.
/python的缺點:
- 執(zhí)行效率偏低,計算密集型任務(wù)需要C++;
- 代碼無法加密;
- 開發(fā)時可供選擇框架過多.
/python的應(yīng)用場景:
- Web應(yīng)用開發(fā)
- 云基礎(chǔ)設(shè)施
- DevOps(開發(fā)運營)
- 網(wǎng)絡(luò)爬蟲開發(fā)
- 數(shù)據(jù)分析挖掘
- 機器學(xué)習(xí)
/環(huán)境搭建:balabalabala
/代碼中的注釋:
- 單行注釋:以#號和空格開頭的部分
- 多行注釋:三個引號開頭,三個引號結(jié)尾
/練習(xí)1:import this
import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
/練習(xí)2:turtle庫
import turtle
turtle.pensize(4)
turtle.pencolor("red")
for i in range(4):
turtle.forward(100)
turtle.right(90)