Getting started with Python second article

Source: Internet
Author: User

Day2

1. Pycharm Installation

#专业版

#no汉化版

2. Data type

Operator:

Arithmetic operations

1 # +    addition 2#  -    subtraction 3#  *    multiplication 4 # /    Division 5#  %    of the remainder of a divided by B 6#  * *    Power  7#  //    ask for an integer part of a divided by B

Comparison operation

1 #Note: The comparison operation results in a Boolean value (that is, True & False)2 #= = equals3 #> Greater than4 #< less than5 #>= greater than or equal to6 #<= less than or equal to7 # !=8 #<> Two is not equal to,! = is more commonly used

Assignment operations

1 #= equivalent, equal to equal sign2 #+ = C+=a equivalent to C = C + a3 #- = c-=a equivalent to C = c-a4 #*= c*=a equivalent to C = c * a5 #/= c/=a equivalent to C = c/a6 #%= c%=a equivalent to C = c% a7 #**= c**=a equivalent to C = c * * A8 #//= c//=a equivalent to C = c//a

Logical operation (with or not gate)

1 #and (with gate) or (or gate) not (non-gate)2 #If T is true,f to false3 #T and T = t T and F = f F and f = f4 #T or T = t t or F = t f or f = f5 #Not t = f not f = t6 7 #Note 1. In a long logical operation, add parentheses to the high-priority operation. 8 #Note 2. In the case of long logical operations, the parentheses are left-to-right according to the book sequence. Easy to use small tips see below9 " "Ten T or ==> result is t, end Operation One T and ==> continue operation A F or ==> continue operation - F and ==> result is f, end Operation - " "

Member operations

1 #example of member Operation2A1 ="Hello World"3 Print("ell" inchA1)#output is True4 Print("ELO" inchA1)#output to False5 Print("ell"  not inchA1)#output to False6 Print("ELO"  not inchA1)#output is True7 #In refers to whether a substring is a subset of a string, and if the output is true8 #not in refers to whether a substring is not a subset of the string, and if the output is true

3. Basic data types

      

1 #Basic data Types2 #numeric (integer) int for example: 1234563 " "Py2, more than a certain size is divided into integer int and long integer type" "4 " "Py3, there is no integral type, it is int" "5 #string str For example ' Hello world '6 #List of lists for example7Name_list = ['Alex','Seven','Eric']8Name_list = List (['Alex','Seven','Eric'])9 #Ganso TupleTenages = (11, 22, 33, 44, 55) Oneages = tuple ((11, 22, 33, 44, 55)) A #Dictionary dict - " "dictionaries are unordered." " -person = {"name":"Mr.wu",' Age': 18} thePerson = Dict ({"name":"Mr.wu",' Age': 18}) - #Boolean value bool True or False

Getting started with Python second article

Related Article

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.