python 入 門

來源:互聯網
上載者:User

標籤:流程   基礎資料型別 (Elementary Data Type)   角度   rom   速度   屏蔽   字母   操作   組合   

  1. python定位
  2. 變數
  3. 使用者與程式互動
  4. 基礎資料型別 (Elementary Data Type)
  5. 格式化輸出
  6. 基本運算子
  7. 流程式控制制之if...else
  8. 流程式控制制之while迴圈
  9. 流程式控制制之for迴圈
  10. 擴充閱讀
  11. 作業

python定位:

#進階語言:站在人(奴隸主)的角度,說人話,即用人類的字元去編寫程式,屏蔽了硬體操作。#解釋型(需要解譯器,相當於同聲傳譯):如python,執行速度慢,調試方便。

 變數:

 如何定義變數:

#變數名(相當於門牌號,指向值所在的空間),等號,變數值name=‘guoxq‘age=18

變數的定義規範:

#1. 變數名只能是 字母、數字或底線的任意組合#2. 變數名的第一個字元不能是數字#3. 關鍵字不能聲明為變數名[‘and‘, ‘as‘, ‘assert‘, ‘break‘, ‘class‘, ‘continue‘, ‘def‘, ‘del‘, ‘elif‘, ‘else‘, ‘except‘, ‘exec‘, ‘finally‘, ‘for‘, ‘from‘, ‘global‘, ‘if‘, ‘import‘, ‘in‘, ‘is‘, ‘lambda‘, ‘not‘, ‘or‘, ‘pass‘, ‘print‘, ‘raise‘, ‘return‘, ‘try‘, ‘while‘, ‘with‘, ‘yield‘]

定義方式:

#底線(推薦使用)age_of_guoxq = 18 number_of_students = 80

定義變數會有:id,type,value

#1 等號比較的是value,#2 is比較的是id#強調:#1. id相同,意味著type和value必定相同#2. value相同type肯定相同,但id可能不同,如下>>> x=‘Info guoxq:18‘>>> y=‘Info guoxq:18‘>>> id(x)4376607152>>> id(y)4376607408>>> >>> x == yTrue>>> x is yFalse

 

 

 

python 入 門

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.