Python environment setup, development tools, basic syntax, and basic python syntax

Source: Internet
Author: User

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

  

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.