Python environment setup, development tools, basic syntax, and basic python syntax
Python Environment
Https://www.python.org/downloads/
Currently, pthon has two versions: 3.5 series and 2.7 series. We recommend that you use the 3.5 version
Development Tools
PyCharm https://www.jetbrains.com/pycharm/
This tool is charged and can be cracked by Baidu.
Tutorial
Http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000
# If elsemoney = 20if money> 10: print (money) else: print (-money) # print () print ("\ n") for line feed ") # multi-row output # If a string contains many line breaks, it is hard to use \ n to write them in a line. To simplify it, Python allows '''... ''' format indicates multi-line content. You can try it yourself: print (''' dsdsddsddsdssdsd''') # Boolean value print (3> 5) print (10> 1) # The and operator is equivalent to the & check = 3> 1 and 5> 3 print ("and", check) in java) # The or operator is equivalent to the | check = 3> 1 or 5 <3 print ("or", check) # not operator is equivalent to the one in java! Check = not 3> 1 print ("not", check) # Dynamic Language a = "abc" # define a variable as, a's type is string a = 10 # value shaping 10 to a, and a is an integer at this time # summary a language like this that does not need to specify the variable type is called a dynamic language, java is a static language, and the variables in java must specify the type # constant name must be capitalized API = "www.baidu.com" # Division 1/the result is a floating point, even if it can be divisible, the result is also a floating point print (10/3) #3.3333333333333335 print (3/10) #0.3 print (10/2) #5.0 # Division 2 // The result is an integer, even if it cannot be divisible, the result is also an integer print (10 // 3) #3 print (10 // 2) #5 print (1 // 10) #0 # obtain the remainder print (1% 3) #1 print (2% 4) #2 print (4% 2) #0