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

Getting started with Python -- day one

編輯:Python

python Initial understanding

python The degree of fire


Data sources :link
It is not difficult to see from the data that in recent years python The popularity of is increasing year by year , So learn python Such a good tool can not only bring us promotion and salary increase , It also means python It can improve our work efficiency . I have studied for a long time python, But it belongs to that kind of · Dongyi hammer , West a mallet . Nothing . So I'm going to spend the next 200 days , Systematic learning python knowledge , And write a blog to sum up their knowledge . This time, , My blog is for myself !

About solving python There are Chinese problems in programming

1. If Sogou input method is not installed on the computer , It is recommended to install a Sogou input method
2.

Right click the icon , Click more settings -> Property settings -> Commonly used -> Use English punctuation in Chinese

About python

1.python It's an interpretative language , The operation efficiency is relatively low ;
2.python Syntax simple language type ;
3.python Is a weak language type ( A variable has no specific data type )

python Basic data type

1.int(integer): It has a wide range of values , It is generally enough in our daily use ; Basic operation :+ - */ %( Remainder ) For division, you should note that the divisor is not 0

( Title source : Cattle from )
If the 0 As divisor , Will produce ZeroDivisioError It's abnormal

2.str(string): Basic operation :+: String splicing , It is required that the spliced parts are all strings , Otherwise, there will be an exception ;*: Followed by an integer , Means to repeat a string n All over

3.bool(boolean): There are only two values True;False. If the proposition is true, then True, A false proposition is False.

python Variable

What is a variable

1. A variable is a value that is temporarily stored during program operation , For subsequent procedures .

Naming rules for variables :

1. Variables can only be composed of alphanumeric underscores
2. Variable variable name cannot be in Chinese
3. When naming variables, do not allow numbers to appear in front
4. Variable naming cannot use the keyword
5. Variable names cannot be too long
6. Variable naming depends on the meaning of the name
7. It is recommended to use hump naming or underline naming for variable naming

User interaction and if sentence

User interaction means using input() Get user input , Note that the value entered by the user is treated as a string .
if sentence :
One .
if Conditions for a :
Results a
Result two

Two .
if Conditions for a :
Results a
else:
Result two

3、 ... and :
if Conditions for a :
Results a
elif Conditions :
Result two
else:
Result three

Four ( nesting ):
if Conditions for a :
Results a
if Condition 2 :
Results a
else:
Result three
Result four
if Judgment can be nested infinitely , But don't nest too much. Generally, you can nest three layers at most

At the end : Little Joe has to work hard to be strong


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