用英語學Python | Day1 Python 入門

What can Python do? Python 可以做什么?

Web開發

Python can be used on a server to create web applications. 在服務器上使用 Python 創建 Web 應用程序。

系統腳本

Python can connect to database systems. It can also read and modify files. 連接到數據庫系統,讀取和修改文件。

數學

Python can be used to handle big data and perform complex mathematics. 處理大數據并執行復雜的數學運算。

軟件開發

Python can be used alongside software to create workflows. 與軟件一起使用創建工作流。

Python can be used for rapid prototyping, or for production-ready software development. 快速原型設計,生產就緒的軟件開發。

Python語法初印象 ——?語法與英語類似

Python has a simple syntax similar to the English language. Python 有一種類似于英語的簡單語法。

Python Syntax compared to other programming languages?

Python 的語法與其他編程語言

Python was designed for readability, and has some similarities to the English language with influence from mathematics. Python 是為可讀性設計的,與英語有一些相似之處,并受到數學的影響。

Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses. Python 使用新行來完成命令,而不像通常使用分號或括號的其他編程語言。

Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose. Python 依賴縮進,使用空格來定義范圍;例如循環、函數和類的范圍。其他編程語言通常使用花括號來實現此目的。

Python Indentation Python 的縮進

Indentation refers to the spaces at the beginning of a code line.?縮進指的是代碼行開頭的空格。

Python uses indentation to indicate a block of code. Python 使用縮進來指示代碼塊。

Python will give you an error if you skip the indentation.?如果省略縮進,Python 會出錯。

The number of spaces is up to you as a programmer, but it has to be at least one.?空格數取決于程序員,但至少需要一個。

You have to use the same number of spaces in the same block of code, otherwise Python will give you an error.?您必須在同一代碼塊中使用相同數量的空格,否則 Python 會出錯。

縮進要點總結:

1. Python用縮進指示代碼塊。

2. 不可省略縮進。

3. 沒有規定空格數,但同一代碼塊中的空格格式要保持一致。


注:英文和中文內容來自www.w3cschool.com

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容