程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python zero basic learning - follow the turtle up master

編輯:Python

y The tool is to use : Recommended IDLE, There are two ways , There are interaction mode and editor mode .IDLE It is more suitable for students who are just beginning to study .

Python Three points to check when an error occurs :1. Check whether the punctuation mark is a punctuation mark in English .2. Check that the indent is correct , Indenting spaces will affect the correctness of the code .3. Check that the function is spelled correctly .

Use of several shortcut keys :Alt+p You can cut to the previous code ,Ctrl+c End of the said

Variables and strings :

Python Variables do not need to be defined , Direct assignment can represent variables , for example :x = 3 There is no need to add a semicolon , Very convenient ,Python The interchange of two numbers is very simple ,C The language borrows the third variable , and Python Unwanted , direct x, y = y, x    When writing assignments , In order to write beautifully , General variables 、 Space 、 be equal to 、 Space 、 The number . You can also add a space after the comma . 

character string : Single quotation marks ' ' Double quotes " " Three quotes ''' ''' , Quotation marks are in English , And they all appear in pairs .

The escape character is in the case of multiple single quotation marks and double quotation marks , In order to make Python Know that this is a simple quotation mark , When there is no other special meaning , Escape characters with backslashes \ Express ..\\ Indicates a simple backslash ,\' Indicates a simple single quotation mark ,\n Means line break ,\r Said the enter , There are still a lot of it , Can read .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved